summaryrefslogtreecommitdiffstats
path: root/osdep-darwin.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-02-11 19:31:58 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-02-11 19:31:58 +0000
commitc6193f7f3f082acc0b0ed2c5faed2e0a27e05b0d (patch)
treef94ba5aa6cd3389470ac8d3bdabaf137056abf1b /osdep-darwin.c
parentd5eaf3a9f6ab9299f76d65e77f11e08f11d9e150 (diff)
Unbreak OS X.
Diffstat (limited to 'osdep-darwin.c')
-rw-r--r--osdep-darwin.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/osdep-darwin.c b/osdep-darwin.c
index 8b37fca3..7f9625b0 100644
--- a/osdep-darwin.c
+++ b/osdep-darwin.c
@@ -1,4 +1,4 @@
-/* $Id: osdep-darwin.c,v 1.6 2009-02-09 18:09:58 nicm Exp $ */
+/* $Id: osdep-darwin.c,v 1.7 2009-02-11 19:31:58 nicm Exp $ */
/*
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
@@ -42,6 +42,8 @@ osdep_get_name(int fd, unused char *tty, unused pid_t *last_pid, char **name)
size_t size;
struct kinfo_proc kp;
+ *name = NULL;
+
if ((mib[3] = tcgetpgrp(fd)) == -1)
return (-1);
@@ -50,7 +52,8 @@ osdep_get_name(int fd, unused char *tty, unused pid_t *last_pid, char **name)
kp.kp_proc.p_comm[0] == '\0')
return (-1);
- return (strdup(kp.kp_proc.p_comm));
+ *name = strdup(kp.kp_proc.p_comm[0]);
+ return (0);
}
#endif