diff options
Diffstat (limited to 'ps.c')
-rw-r--r-- | ps.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -216,11 +216,11 @@ extern int ps_main(int argc, char **argv) | |||
216 | /* open device */ | 216 | /* open device */ |
217 | fd = open(device, O_RDONLY); | 217 | fd = open(device, O_RDONLY); |
218 | if (fd < 0) | 218 | if (fd < 0) |
219 | error_msg_and_die( "open failed for `%s': %s\n", device, strerror (errno)); | 219 | perror_msg_and_die( "open failed for `%s'", device); |
220 | 220 | ||
221 | /* Find out how many processes there are */ | 221 | /* Find out how many processes there are */ |
222 | if (ioctl (fd, DEVPS_GET_NUM_PIDS, &num_pids)<0) | 222 | if (ioctl (fd, DEVPS_GET_NUM_PIDS, &num_pids)<0) |
223 | error_msg_and_die( "\nDEVPS_GET_PID_LIST: %s\n", strerror (errno)); | 223 | perror_msg_and_die( "\nDEVPS_GET_PID_LIST"); |
224 | 224 | ||
225 | /* Allocate some memory -- grab a few extras just in case | 225 | /* Allocate some memory -- grab a few extras just in case |
226 | * some new processes start up while we wait. The kernel will | 226 | * some new processes start up while we wait. The kernel will |
@@ -231,7 +231,7 @@ extern int ps_main(int argc, char **argv) | |||
231 | 231 | ||
232 | /* Now grab the pid list */ | 232 | /* Now grab the pid list */ |
233 | if (ioctl (fd, DEVPS_GET_PID_LIST, pid_array)<0) | 233 | if (ioctl (fd, DEVPS_GET_PID_LIST, pid_array)<0) |
234 | error_msg_and_die("\nDEVPS_GET_PID_LIST: %s\n", strerror (errno)); | 234 | perror_msg_and_die("\nDEVPS_GET_PID_LIST"); |
235 | 235 | ||
236 | #ifdef BB_FEATURE_AUTOWIDTH | 236 | #ifdef BB_FEATURE_AUTOWIDTH |
237 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 237 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |
@@ -247,7 +247,7 @@ extern int ps_main(int argc, char **argv) | |||
247 | info.pid = pid_array[i]; | 247 | info.pid = pid_array[i]; |
248 | 248 | ||
249 | if (ioctl (fd, DEVPS_GET_PID_INFO, &info)<0) | 249 | if (ioctl (fd, DEVPS_GET_PID_INFO, &info)<0) |
250 | error_msg_and_die("\nDEVPS_GET_PID_INFO: %s\n", strerror (errno)); | 250 | perror_msg_and_die("\nDEVPS_GET_PID_INFO"); |
251 | 251 | ||
252 | /* Make some adjustments as needed */ | 252 | /* Make some adjustments as needed */ |
253 | my_getpwuid(uidName, info.euid); | 253 | my_getpwuid(uidName, info.euid); |
@@ -277,7 +277,7 @@ extern int ps_main(int argc, char **argv) | |||
277 | 277 | ||
278 | /* close device */ | 278 | /* close device */ |
279 | if (close (fd) != 0) | 279 | if (close (fd) != 0) |
280 | error_msg_and_die("close failed for `%s': %s\n", device, strerror (errno)); | 280 | perror_msg_and_die("close failed for `%s'", device); |
281 | 281 | ||
282 | exit (0); | 282 | exit (0); |
283 | } | 283 | } |