diff options
author | Damien Miller <djm@mindrot.org> | 2003-01-10 09:53:12 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-01-10 09:53:12 +1100 |
commit | a8ed44b79e6dd78d7871b0fb8149951b54662ef5 (patch) | |
tree | cca59d396ec59133ec1c42536eca25d087dcfcc7 /openbsd-compat/bsd-misc.c | |
parent | 13b2e55c36ec316bd4ec15e830c9eae888d2cb68 (diff) |
- (djm) Enable new setproctitle emulation for Linux, AIX and HP/UX. More
systems may be added later.
Diffstat (limited to 'openbsd-compat/bsd-misc.c')
-rw-r--r-- | openbsd-compat/bsd-misc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 1c1e43a52..d7180d424 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -23,15 +23,20 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | #include "xmalloc.h" | ||
26 | 27 | ||
27 | RCSID("$Id: bsd-misc.c,v 1.10 2002/07/08 21:09:41 mouring Exp $"); | 28 | RCSID("$Id: bsd-misc.c,v 1.11 2003/01/09 22:53:13 djm Exp $"); |
28 | 29 | ||
30 | /* | ||
31 | * NB. duplicate __progname in case it is an alias for argv[0] | ||
32 | * Otherwise it may get clobbered by setproctitle() | ||
33 | */ | ||
29 | char *get_progname(char *argv0) | 34 | char *get_progname(char *argv0) |
30 | { | 35 | { |
31 | #ifdef HAVE___PROGNAME | 36 | #ifdef HAVE___PROGNAME |
32 | extern char *__progname; | 37 | extern char *__progname; |
33 | 38 | ||
34 | return __progname; | 39 | return xstrdup(__progname); |
35 | #else | 40 | #else |
36 | char *p; | 41 | char *p; |
37 | 42 | ||
@@ -42,7 +47,8 @@ char *get_progname(char *argv0) | |||
42 | p = argv0; | 47 | p = argv0; |
43 | else | 48 | else |
44 | p++; | 49 | p++; |
45 | return p; | 50 | |
51 | return xstrdup(p); | ||
46 | #endif | 52 | #endif |
47 | } | 53 | } |
48 | 54 | ||