]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/sm-notify.c
sm-notify: Disable syslog messages when debugging is enabled
[nfs-utils.git] / utils / statd / sm-notify.c
index b7f43715b5e536d284571a7a506aaed9942b3a7d..f05eadf5d5b43e2be52525ac5c515a4253c80fcd 100644 (file)
 #include "nsm.h"
 #include "nfsrpc.h"
 
+/* glibc before 2.3.4 */
+#ifndef AI_NUMERICSERV
+#define AI_NUMERICSERV 0
+#endif
+
 #define NSM_TIMEOUT    2
 #define NSM_MAX_TIMEOUT        120     /* don't make this too big */
 
@@ -248,6 +253,7 @@ smn_bind_address(const char *srcaddr, const char *srcport)
        if (srcaddr == NULL)
                hint.ai_flags |= AI_PASSIVE;
 
+       /* Do not allow "node" and "service" parameters both to be NULL */
        if (srcport == NULL)
                error = getaddrinfo(srcaddr, "", &hint, &ai);
        else
@@ -389,12 +395,14 @@ usage:            fprintf(stderr,
                exit(1);
        }
 
-       xlog_syslog(1);
        if (opt_debug) {
+               xlog_syslog(0);
                xlog_stderr(1);
                xlog_config(D_ALL, 1);
-       } else
+       } else {
+               xlog_syslog(1);
                xlog_stderr(0);
+       }
 
        xlog_open(progname);
        xlog(L_NOTICE, "Version " VERSION " starting");