diff mbox

[rdma-core,4/8] Consistently open syslog in daemons

Message ID 1501099152-6344-5-git-send-email-jgunthorpe@obsidianresearch.com (mailing list archive)
State Accepted
Headers show

Commit Message

Jason Gunthorpe July 26, 2017, 7:59 p.m. UTC
These days we can use the POSIX 2008 format to automatically
set the program name. We always want fallback to console if syslog
is broken, and if we are calling openlog should take effect
immediately.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
---
 iwpmd/iwarp_pm_server.c | 2 +-
 rdma-ndd/rdma-ndd.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/iwpmd/iwarp_pm_server.c b/iwpmd/iwarp_pm_server.c
index 53f61b2876b9b5..a0a877b91b0c60 100644
--- a/iwpmd/iwarp_pm_server.c
+++ b/iwpmd/iwarp_pm_server.c
@@ -1400,7 +1400,7 @@  int main(int argc, char *argv[])
 	FILE *fp;
 	int ret = EXIT_FAILURE;
 
-	openlog("iWarpPortMapper", LOG_CONS | LOG_PID, LOG_DAEMON);
+	openlog(NULL, LOG_NDELAY | LOG_CONS | LOG_PID, LOG_DAEMON);
 
 	daemonize_iwpm_server();
 
diff --git a/rdma-ndd/rdma-ndd.c b/rdma-ndd/rdma-ndd.c
index e7be22b12ad6a1..3e99d2dc5332dc 100644
--- a/rdma-ndd/rdma-ndd.c
+++ b/rdma-ndd/rdma-ndd.c
@@ -286,7 +286,7 @@  int main(int argc, char *argv[])
 {
 	bool foreground = false;
 
-	openlog("rdma-ndd", LOG_PID, LOG_DAEMON);
+	openlog(NULL, LOG_NDELAY | LOG_CONS | LOG_PID, LOG_DAEMON);
 
 	while (1) {
 		int opt_idx = 0;