diff options
author | Steve Dickson <steved@redhat.com> | 2015-02-04 12:05:10 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2015-02-05 10:18:42 -0500 |
commit | 2f10c4aad6c24e642913e37dfb0c35e36b68b8d7 (patch) | |
tree | f9de95a87ab287e41639aeb79c7d8ef169fe9c34 | |
parent | bc2b14b27b7edad0c32e177067634ecc529bdcbb (diff) | |
download | rpcbind-2f10c4aad6c24e642913e37dfb0c35e36b68b8d7.tar.gz |
rpcbind: Separate the -d flag from the -f flag
To make it possible for debugging to happen in
background, separate the -d flag from the -f flag
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | man/rpcbind.8 | 4 | ||||
-rw-r--r-- | src/rpcbind.c | 16 |
2 files changed, 9 insertions, 11 deletions
diff --git a/man/rpcbind.8 b/man/rpcbind.8 index da32701..af6200f 100644 --- a/man/rpcbind.8 +++ b/man/rpcbind.8 @@ -76,8 +76,8 @@ do an abort on errors. Run in debug mode. In this mode, .Nm -will not fork when it starts, will print additional information -during operation, and will abort on certain errors if +will log additional information during operation, +and will abort on certain errors if .Fl a is also specified. With this option, the name-to-address translation consistency diff --git a/src/rpcbind.c b/src/rpcbind.c index 2236d79..6d8bed2 100644 --- a/src/rpcbind.c +++ b/src/rpcbind.c @@ -230,18 +230,16 @@ main(int argc, char *argv[]) (void) signal(SIGUSR1, SIG_IGN); (void) signal(SIGUSR2, SIG_IGN); - if (debugging) { #ifdef RPCBIND_DEBUG - printf("rpcbind debugging enabled."); - if (doabort) { - printf(" Will abort on errors!\n"); - } else { - printf("\n"); - } + if (debugging) { + xlog(LOG_DEBUG, "debugging enabled."); + if (doabort) + xlog(LOG_DEBUG, "Will abort on errors!\n"); + } #endif - } else if (dofork) { + if (dofork) { if (daemon(0, 0)) - err(1, "fork failed"); + err(1, "fork failed"); } if (runasdaemon || rpcbinduser) { |