lib: Use FreeBSD libc function for proctitle
authorEd Maste <emaste@adaranet.com>
Thu, 11 Oct 2012 20:58:17 +0000 (20:58 +0000)
committerBen Pfaff <blp@nicira.com>
Thu, 11 Oct 2012 21:22:49 +0000 (14:22 -0700)
FreeBSD libc's setproctitle provides the same interface as proctitle_set so
use it directly.

Signed-off-by: Ed Maste <emaste@adaranet.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/command-line.c
lib/command-line.h

index 07935d6..b881c04 100644 (file)
@@ -190,10 +190,13 @@ proctitle_init(int argc OVS_UNUSED, char **argv OVS_UNUSED)
 {
 }
 
+#ifndef __FreeBSD__
+/* On FreeBSD we #define this to setproctitle. */
 void
 proctitle_set(const char *format OVS_UNUSED, ...)
 {
 }
+#endif
 
 void
 proctitle_restore(void)
index 803f433..2592b79 100644 (file)
@@ -34,8 +34,12 @@ char *long_options_to_short_options(const struct option *options);
 void run_command(int argc, char *argv[], const struct command[]);
 
 void proctitle_init(int argc, char **argv);
+#ifdef __FreeBSD__
+#define proctitle_set setproctitle
+#else
 void proctitle_set(const char *, ...)
     PRINTF_FORMAT(1, 2);
+#endif
 void proctitle_restore(void);
 
 #endif /* command-line.h */