diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/kill.c | 14 | ||||
-rw-r--r-- | procps/ps.c | 18 | ||||
-rw-r--r-- | procps/renice.c | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/procps/kill.c b/procps/kill.c index dd5ca49fa..caaa52a5b 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 | fatalError( "Bad PID: %s\n", strerror(errno)); | 207 | error_msg_and_die( "Bad PID: %s\n", strerror(errno)); |
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 | fatalError( "Could not kill pid '%d': %s\n", pid, strerror(errno)); | 210 | error_msg_and_die( "Could not kill pid '%d': %s\n", pid, strerror(errno)); |
211 | argv++; | 211 | argv++; |
212 | } | 212 | } |
213 | } | 213 | } |
@@ -219,20 +219,20 @@ extern int kill_main(int argc, char **argv) | |||
219 | while (--argc >= 0) { | 219 | while (--argc >= 0) { |
220 | pid_t* pidList; | 220 | pid_t* pidList; |
221 | 221 | ||
222 | pidList = findPidByName( *argv); | 222 | pidList = find_pid_by_name( *argv); |
223 | if (!pidList) { | 223 | if (!pidList) { |
224 | all_found = FALSE; | 224 | all_found = FALSE; |
225 | errorMsg( "%s: no process killed\n", *argv); | 225 | error_msg( "%s: no process killed\n", *argv); |
226 | } | 226 | } |
227 | 227 | ||
228 | for(; pidList && *pidList!=0; pidList++) { | 228 | for(; pidList && *pidList!=0; pidList++) { |
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 | fatalError( "Could not kill pid '%d': %s\n", *pidList, strerror(errno)); | 232 | error_msg_and_die( "Could not kill pid '%d': %s\n", *pidList, strerror(errno)); |
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 findPidByName(). It will be freed | 235 | * allocated in find_pid_by_name(). It will be freed |
236 | * upon exit, so we can save a byte or two */ | 236 | * upon exit, so we can save a byte or two */ |
237 | argv++; | 237 | argv++; |
238 | } | 238 | } |
@@ -245,5 +245,5 @@ extern int kill_main(int argc, char **argv) | |||
245 | 245 | ||
246 | 246 | ||
247 | end: | 247 | end: |
248 | fatalError( "bad signal name: %s\n", *argv); | 248 | error_msg_and_die( "bad signal name: %s\n", *argv); |
249 | } | 249 | } |
diff --git a/procps/ps.c b/procps/ps.c index 4998e15b1..79910fe34 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -97,20 +97,20 @@ static void parse_proc_status(char *S, proc_t * P) | |||
97 | if (tmp) | 97 | if (tmp) |
98 | sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid); | 98 | sscanf(tmp, "Pid:\t%d\n" "PPid:\t%d\n", &P->pid, &P->ppid); |
99 | else | 99 | else |
100 | errorMsg("Internal error!\n"); | 100 | error_msg("Internal error!\n"); |
101 | 101 | ||
102 | /* For busybox, ignoring effective, saved, etc */ | 102 | /* For busybox, ignoring effective, saved, etc */ |
103 | tmp = strstr(S, "Uid:"); | 103 | tmp = strstr(S, "Uid:"); |
104 | if (tmp) | 104 | if (tmp) |
105 | sscanf(tmp, "Uid:\t%d", &P->ruid); | 105 | sscanf(tmp, "Uid:\t%d", &P->ruid); |
106 | else | 106 | else |
107 | errorMsg("Internal error!\n"); | 107 | error_msg("Internal error!\n"); |
108 | 108 | ||
109 | tmp = strstr(S, "Gid:"); | 109 | tmp = strstr(S, "Gid:"); |
110 | if (tmp) | 110 | if (tmp) |
111 | sscanf(tmp, "Gid:\t%d", &P->rgid); | 111 | sscanf(tmp, "Gid:\t%d", &P->rgid); |
112 | else | 112 | else |
113 | errorMsg("Internal error!\n"); | 113 | error_msg("Internal error!\n"); |
114 | 114 | ||
115 | } | 115 | } |
116 | 116 | ||
@@ -135,7 +135,7 @@ extern int ps_main(int argc, char **argv) | |||
135 | 135 | ||
136 | dir = opendir("/proc"); | 136 | dir = opendir("/proc"); |
137 | if (!dir) | 137 | if (!dir) |
138 | fatalError("Can't open /proc\n"); | 138 | error_msg_and_die("Can't open /proc\n"); |
139 | 139 | ||
140 | #ifdef BB_FEATURE_AUTOWIDTH | 140 | #ifdef BB_FEATURE_AUTOWIDTH |
141 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 141 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |
@@ -219,11 +219,11 @@ extern int ps_main(int argc, char **argv) | |||
219 | /* open device */ | 219 | /* open device */ |
220 | fd = open(device, O_RDONLY); | 220 | fd = open(device, O_RDONLY); |
221 | if (fd < 0) | 221 | if (fd < 0) |
222 | fatalError( "open failed for `%s': %s\n", device, strerror (errno)); | 222 | error_msg_and_die( "open failed for `%s': %s\n", device, strerror (errno)); |
223 | 223 | ||
224 | /* Find out how many processes there are */ | 224 | /* Find out how many processes there are */ |
225 | if (ioctl (fd, DEVPS_GET_NUM_PIDS, &num_pids)<0) | 225 | if (ioctl (fd, DEVPS_GET_NUM_PIDS, &num_pids)<0) |
226 | fatalError( "\nDEVPS_GET_PID_LIST: %s\n", strerror (errno)); | 226 | error_msg_and_die( "\nDEVPS_GET_PID_LIST: %s\n", strerror (errno)); |
227 | 227 | ||
228 | /* Allocate some memory -- grab a few extras just in case | 228 | /* Allocate some memory -- grab a few extras just in case |
229 | * some new processes start up while we wait. The kernel will | 229 | * some new processes start up while we wait. The kernel will |
@@ -234,7 +234,7 @@ extern int ps_main(int argc, char **argv) | |||
234 | 234 | ||
235 | /* Now grab the pid list */ | 235 | /* Now grab the pid list */ |
236 | if (ioctl (fd, DEVPS_GET_PID_LIST, pid_array)<0) | 236 | if (ioctl (fd, DEVPS_GET_PID_LIST, pid_array)<0) |
237 | fatalError("\nDEVPS_GET_PID_LIST: %s\n", strerror (errno)); | 237 | error_msg_and_die("\nDEVPS_GET_PID_LIST: %s\n", strerror (errno)); |
238 | 238 | ||
239 | #ifdef BB_FEATURE_AUTOWIDTH | 239 | #ifdef BB_FEATURE_AUTOWIDTH |
240 | ioctl(fileno(stdout), TIOCGWINSZ, &win); | 240 | ioctl(fileno(stdout), TIOCGWINSZ, &win); |
@@ -252,7 +252,7 @@ extern int ps_main(int argc, char **argv) | |||
252 | info.pid = pid_array[i]; | 252 | info.pid = pid_array[i]; |
253 | 253 | ||
254 | if (ioctl (fd, DEVPS_GET_PID_INFO, &info)<0) | 254 | if (ioctl (fd, DEVPS_GET_PID_INFO, &info)<0) |
255 | fatalError("\nDEVPS_GET_PID_INFO: %s\n", strerror (errno)); | 255 | error_msg_and_die("\nDEVPS_GET_PID_INFO: %s\n", strerror (errno)); |
256 | 256 | ||
257 | /* Make some adjustments as needed */ | 257 | /* Make some adjustments as needed */ |
258 | my_getpwuid(uidName, info.euid); | 258 | my_getpwuid(uidName, info.euid); |
@@ -282,7 +282,7 @@ extern int ps_main(int argc, char **argv) | |||
282 | 282 | ||
283 | /* close device */ | 283 | /* close device */ |
284 | if (close (fd) != 0) | 284 | if (close (fd) != 0) |
285 | fatalError("close failed for `%s': %s\n", device, strerror (errno)); | 285 | error_msg_and_die("close failed for `%s': %s\n", device, strerror (errno)); |
286 | 286 | ||
287 | exit (0); | 287 | exit (0); |
288 | } | 288 | } |
diff --git a/procps/renice.c b/procps/renice.c index c81f31c5c..8f0618126 100644 --- a/procps/renice.c +++ b/procps/renice.c | |||
@@ -44,7 +44,7 @@ extern int renice_main(int argc, char **argv) | |||
44 | if (setpriority(PRIO_PROCESS, ps, prio) == 0) { | 44 | if (setpriority(PRIO_PROCESS, ps, prio) == 0) { |
45 | printf("%d: old priority %d, new priority %d\n", ps, oldp, prio ); | 45 | printf("%d: old priority %d, new priority %d\n", ps, oldp, prio ); |
46 | } else { | 46 | } else { |
47 | perrorMsg("%d: setpriority", ps); | 47 | perror_msg("%d: setpriority", ps); |
48 | status = EXIT_FAILURE; | 48 | status = EXIT_FAILURE; |
49 | } | 49 | } |
50 | } | 50 | } |