summaryrefslogtreecommitdiffstats
path: root/osdep-freebsd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-02-09 18:09:58 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-02-09 18:09:58 +0000
commit1b036c1ca9a311638e4b73e91055f7faee8ebed3 (patch)
treeda62105d286c7cba2fe85783c02f3e697d42ecf4 /osdep-freebsd.c
parentc9cfc9a9f356386e07e6273f91dd3d46ca076c12 (diff)
Return -1 not NULL on error. Doh.
Diffstat (limited to 'osdep-freebsd.c')
-rw-r--r--osdep-freebsd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/osdep-freebsd.c b/osdep-freebsd.c
index 7b7475ee..bad06132 100644
--- a/osdep-freebsd.c
+++ b/osdep-freebsd.c
@@ -1,4 +1,4 @@
-/* $Id: osdep-freebsd.c,v 1.12 2009-02-09 18:08:01 nicm Exp $ */
+/* $Id: osdep-freebsd.c,v 1.13 2009-02-09 18:09:58 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -55,18 +55,18 @@ osdep_get_name(int fd, char *tty, pid_t *last_pid, char **name)
buf = NULL;
if (stat(tty, &sb) == -1)
- return (NULL);
+ return (-1);
if ((mib[3] = tcgetpgrp(fd)) == -1)
- return (NULL);
+ return (-1);
retry:
if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) == -1)
- return (NULL);
+ return (-1);
len = (len * 5) / 4;
if ((newbuf = realloc(buf, len)) == NULL) {
free(buf);
- return (NULL);
+ return (-1);
}
buf = newbuf;
@@ -74,7 +74,7 @@ retry:
if (errno == ENOMEM)
goto retry;
free(buf);
- return (NULL);
+ return (-1);
}
bestp = NULL;