Use %u for process group on Sun OS.

pull/1/head
Nicholas Marriott 2011-09-11 23:54:32 +00:00
parent 4a01da19df
commit 99f78340af
1 changed files with 2 additions and 3 deletions

View File

@ -41,14 +41,13 @@ osdep_get_name(int fd, char *tty)
if ((f = open(tty, O_RDONLY)) < 0)
return (NULL);
if ((fstat(f, &st) != 0) ||
(ioctl(f, TIOCGPGRP, &pgrp) != 0)) {
if (fstat(f, &st) != 0 || ioctl(f, TIOCGPGRP, &pgrp) != 0) {
close(f);
return (NULL);
}
close(f);
xasprintf(&path, "/proc/%hu/psinfo", pgrp);
xasprintf(&path, "/proc/%u/psinfo", (u_int) pgrp);
f = open(path, O_RDONLY);
xfree(path);
if (f < 0)