diff options
Diffstat (limited to 'ps.c')
-rw-r--r-- | ps.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 | } |