From 2f10c4aad6c24e642913e37dfb0c35e36b68b8d7 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Wed, 4 Feb 2015 12:05:10 -0500 Subject: 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 --- man/rpcbind.8 | 4 ++-- 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) { -- cgit v1.2.1