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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxx>
---
 iwpmd/iwarp_pm_server.c | 2 +-
 rdma-ndd/rdma-ndd.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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;
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux