From: Ed Maste Date: Thu, 11 Oct 2012 20:58:17 +0000 (+0000) Subject: lib: Use FreeBSD libc function for proctitle X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb301c748ca23e6ee805488591d572341470d720;p=openvswitch lib: Use FreeBSD libc function for proctitle FreeBSD libc's setproctitle provides the same interface as proctitle_set so use it directly. Signed-off-by: Ed Maste Signed-off-by: Ben Pfaff --- diff --git a/lib/command-line.c b/lib/command-line.c index 07935d6a..b881c042 100644 --- a/lib/command-line.c +++ b/lib/command-line.c @@ -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) diff --git a/lib/command-line.h b/lib/command-line.h index 803f4339..2592b79e 100644 --- a/lib/command-line.h +++ b/lib/command-line.h @@ -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 */