diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/kill.c | 6 | ||||
-rw-r--r-- | procps/ps.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/procps/kill.c b/procps/kill.c index caaa52a5b..8fa9da77d 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -204,10 +204,10 @@ extern int kill_main(int argc, char **argv) | |||
204 | int pid; | 204 | int pid; |
205 | 205 | ||
206 | if (!isdigit(**argv)) | 206 | if (!isdigit(**argv)) |
207 | error_msg_and_die( "Bad PID: %s\n", strerror(errno)); | 207 | perror_msg_and_die( "Bad PID"); |
208 | pid = strtol(*argv, NULL, 0); | 208 | pid = strtol(*argv, NULL, 0); |
209 | if (kill(pid, sig) != 0) | 209 | if (kill(pid, sig) != 0) |
210 | error_msg_and_die( "Could not kill pid '%d': %s\n", pid, strerror(errno)); | 210 | perror_msg_and_die( "Could not kill pid '%d'", pid); |
211 | argv++; | 211 | argv++; |
212 | } | 212 | } |
213 | } | 213 | } |
@@ -229,7 +229,7 @@ extern int kill_main(int argc, char **argv) | |||
229 | if (*pidList==myPid) | 229 | if (*pidList==myPid) |
230 | continue; | 230 | continue; |
231 | if (kill(*pidList, sig) != 0) | 231 | if (kill(*pidList, sig) != 0) |
232 | error_msg_and_die( "Could not kill pid '%d': %s\n", *pidList, strerror(errno)); | 232 | perror_msg_and_die( "Could not kill pid '%d'", *pidList); |
233 | } | 233 | } |
234 | /* Note that we don't bother to free the memory | 234 | /* Note that we don't bother to free the memory |
235 | * allocated in find_pid_by_name(). It will be freed | 235 | * allocated in find_pid_by_name(). It will be freed |
diff --git a/procps/ps.c b/procps/ps.c index 357ece383..2b41a495f 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -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 | } |