mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-23 05:41:21 +01:00
Further unbreakage.
This commit is contained in:
parent
c6193f7f3f
commit
e0fe64b464
@ -1,4 +1,4 @@
|
||||
/* $Id: osdep-darwin.c,v 1.7 2009-02-11 19:31:58 nicm Exp $ */
|
||||
/* $Id: osdep-darwin.c,v 1.8 2009-02-11 19:35:50 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
|
||||
@ -48,11 +48,12 @@ osdep_get_name(int fd, unused char *tty, unused pid_t *last_pid, char **name)
|
||||
return (-1);
|
||||
|
||||
size = sizeof kp;
|
||||
if (sysctl(mib, 4, &kp, &size, NULL, 0) == -1 ||
|
||||
kp.kp_proc.p_comm[0] == '\0')
|
||||
if (sysctl(mib, 4, &kp, &size, NULL, 0) == -1)
|
||||
return (-1);
|
||||
if (*kp.kp_proc.p_comm == '\0')
|
||||
return (-1);
|
||||
|
||||
*name = strdup(kp.kp_proc.p_comm[0]);
|
||||
*name = strdup(kp.kp_proc.p_comm);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user