summaryrefslogtreecommitdiffstats
path: root/bsd-misc.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2000-11-17 04:47:20 +0100
committerBen Lindstrom <mouring@eviladmin.org>2000-11-17 04:47:20 +0100
commit49a79c09762613f29601ef2470d13952168021be (patch)
tree140539420c10c5b358481cadcec495a5a41103fd /bsd-misc.c
parent20001117 (diff)
downloadopenssh-49a79c09762613f29601ef2470d13952168021be.tar.xz
openssh-49a79c09762613f29601ef2470d13952168021be.zip
- (stevek) Reworked progname support.
- (bal) Misplaced #include "includes.h" in bsd-setproctitle.c. Patch by Shinichi Maruyama <marya@st.jip.co.jp> I assume the progname patch was finished. I believe stevek is on vacation, but it passes compiling under Linux and NeXTStep.
Diffstat (limited to 'bsd-misc.c')
-rw-r--r--bsd-misc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/bsd-misc.c b/bsd-misc.c
index 59814946c..2a0596593 100644
--- a/bsd-misc.c
+++ b/bsd-misc.c
@@ -26,6 +26,26 @@
#include "xmalloc.h"
#include "ssh.h"
+char *get_progname(char *argv0)
+{
+#ifdef HAVE___PROGNAME
+ extern char *__progname;
+
+ return __progname;
+#else
+ char *p;
+
+ if (argv0 == NULL)
+ return "unknown"; /* XXX */
+ p = strrchr(argv0, '/');
+ if (p == NULL)
+ p = argv0;
+ else
+ p++;
+ return p;
+#endif
+}
+
#ifndef HAVE_SETLOGIN
int setlogin(const char *name)
{