diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
commit | cad5364599eb5062d59e0c397ed638ddd61a8d5d (patch) | |
tree | a318d0f03aa076c74b576ea45dc543a5669e8e91 /procps | |
parent | e01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff) | |
download | busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2 busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip |
Major coreutils update.
Diffstat (limited to 'procps')
-rw-r--r-- | procps/free.c | 2 | ||||
-rw-r--r-- | procps/kill.c | 16 | ||||
-rw-r--r-- | procps/pidof.c | 2 | ||||
-rw-r--r-- | procps/renice.c | 4 | ||||
-rw-r--r-- | procps/top.c | 20 |
5 files changed, 22 insertions, 22 deletions
diff --git a/procps/free.c b/procps/free.c index 4a5469b10..2f520e418 100644 --- a/procps/free.c +++ b/procps/free.c | |||
@@ -63,7 +63,7 @@ extern int free_main(int argc, char **argv) | |||
63 | } | 63 | } |
64 | 64 | ||
65 | if (argc > 1 && **(argv + 1) == '-') | 65 | if (argc > 1 && **(argv + 1) == '-') |
66 | show_usage(); | 66 | bb_show_usage(); |
67 | 67 | ||
68 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", | 68 | printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", |
69 | "shared", "buffers"); | 69 | "shared", "buffers"); |
diff --git a/procps/kill.c b/procps/kill.c index c7a3c7f72..3d6fe80cb 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -44,7 +44,7 @@ extern int kill_main(int argc, char **argv) | |||
44 | 44 | ||
45 | #ifdef CONFIG_KILLALL | 45 | #ifdef CONFIG_KILLALL |
46 | /* Figure out what we are trying to do here */ | 46 | /* Figure out what we are trying to do here */ |
47 | whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; | 47 | whichApp = (strcmp(bb_applet_name, "killall") == 0)? KILLALL : KILL; |
48 | #else | 48 | #else |
49 | whichApp = KILL; | 49 | whichApp = KILL; |
50 | #endif | 50 | #endif |
@@ -54,7 +54,7 @@ extern int kill_main(int argc, char **argv) | |||
54 | argv++; | 54 | argv++; |
55 | /* Parse any options */ | 55 | /* Parse any options */ |
56 | if (argc < 1) | 56 | if (argc < 1) |
57 | show_usage(); | 57 | bb_show_usage(); |
58 | 58 | ||
59 | while (argc > 0 && **argv == '-') { | 59 | while (argc > 0 && **argv == '-') { |
60 | while (*++(*argv)) { | 60 | while (*++(*argv)) { |
@@ -87,11 +87,11 @@ extern int kill_main(int argc, char **argv) | |||
87 | } | 87 | } |
88 | return EXIT_SUCCESS; | 88 | return EXIT_SUCCESS; |
89 | case '-': | 89 | case '-': |
90 | show_usage(); | 90 | bb_show_usage(); |
91 | default: | 91 | default: |
92 | name = u_signal_names(*argv, &sig, 0); | 92 | name = u_signal_names(*argv, &sig, 0); |
93 | if(name==NULL) | 93 | if(name==NULL) |
94 | error_msg_and_die( "bad signal name: %s", *argv); | 94 | bb_error_msg_and_die( "bad signal name: %s", *argv); |
95 | argc--; | 95 | argc--; |
96 | argv++; | 96 | argv++; |
97 | goto do_it_now; | 97 | goto do_it_now; |
@@ -109,10 +109,10 @@ do_it_now: | |||
109 | int pid; | 109 | int pid; |
110 | 110 | ||
111 | if (!isdigit(**argv)) | 111 | if (!isdigit(**argv)) |
112 | perror_msg_and_die( "Bad PID"); | 112 | bb_perror_msg_and_die( "Bad PID"); |
113 | pid = strtol(*argv, NULL, 0); | 113 | pid = strtol(*argv, NULL, 0); |
114 | if (kill(pid, sig) != 0) { | 114 | if (kill(pid, sig) != 0) { |
115 | perror_msg( "Could not kill pid '%d'", pid); | 115 | bb_perror_msg( "Could not kill pid '%d'", pid); |
116 | errors++; | 116 | errors++; |
117 | } | 117 | } |
118 | argv++; | 118 | argv++; |
@@ -130,7 +130,7 @@ do_it_now: | |||
130 | if (*pidList <= 0) { | 130 | if (*pidList <= 0) { |
131 | errors++; | 131 | errors++; |
132 | if (quiet==0) | 132 | if (quiet==0) |
133 | error_msg( "%s: no process killed", *argv); | 133 | bb_error_msg( "%s: no process killed", *argv); |
134 | } else { | 134 | } else { |
135 | long *pl; | 135 | long *pl; |
136 | 136 | ||
@@ -140,7 +140,7 @@ do_it_now: | |||
140 | if (kill(*pl, sig) != 0) { | 140 | if (kill(*pl, sig) != 0) { |
141 | errors++; | 141 | errors++; |
142 | if (quiet==0) | 142 | if (quiet==0) |
143 | perror_msg( "Could not kill pid '%ld'", *pl); | 143 | bb_perror_msg( "Could not kill pid '%ld'", *pl); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | } | 146 | } |
diff --git a/procps/pidof.c b/procps/pidof.c index 8cd1a91c8..d77f7f02b 100644 --- a/procps/pidof.c +++ b/procps/pidof.c | |||
@@ -46,7 +46,7 @@ extern int pidof_main(int argc, char **argv) | |||
46 | single_flag = 1; | 46 | single_flag = 1; |
47 | break; | 47 | break; |
48 | default: | 48 | default: |
49 | show_usage(); | 49 | bb_show_usage(); |
50 | } | 50 | } |
51 | } | 51 | } |
52 | 52 | ||
diff --git a/procps/renice.c b/procps/renice.c index ec35bdcde..a81156eea 100644 --- a/procps/renice.c +++ b/procps/renice.c | |||
@@ -32,7 +32,7 @@ extern int renice_main(int argc, char **argv) | |||
32 | { | 32 | { |
33 | int prio, status = EXIT_SUCCESS; | 33 | int prio, status = EXIT_SUCCESS; |
34 | 34 | ||
35 | if (argc < 3) show_usage(); | 35 | if (argc < 3) bb_show_usage(); |
36 | 36 | ||
37 | prio = atoi(*++argv); | 37 | prio = atoi(*++argv); |
38 | if (prio > 20) prio = 20; | 38 | if (prio > 20) prio = 20; |
@@ -45,7 +45,7 @@ extern int renice_main(int argc, char **argv) | |||
45 | if (setpriority(PRIO_PROCESS, ps, prio) == 0) { | 45 | if (setpriority(PRIO_PROCESS, ps, prio) == 0) { |
46 | printf("%d: old priority %d, new priority %d\n", ps, oldp, prio ); | 46 | printf("%d: old priority %d, new priority %d\n", ps, oldp, prio ); |
47 | } else { | 47 | } else { |
48 | perror_msg("%d: setpriority", ps); | 48 | bb_perror_msg("%d: setpriority", ps); |
49 | status = EXIT_FAILURE; | 49 | status = EXIT_FAILURE; |
50 | } | 50 | } |
51 | } | 51 | } |
diff --git a/procps/top.c b/procps/top.c index 4204deaf2..b70a42a72 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -155,11 +155,11 @@ static unsigned long Hertz; | |||
155 | 155 | ||
156 | #define FILE_TO_BUF(filename, fd) do{ \ | 156 | #define FILE_TO_BUF(filename, fd) do{ \ |
157 | if (fd == -1 && (fd = open(filename, O_RDONLY)) == -1) { \ | 157 | if (fd == -1 && (fd = open(filename, O_RDONLY)) == -1) { \ |
158 | perror_msg_and_die("/proc not be mounted?"); \ | 158 | bb_perror_msg_and_die("/proc not be mounted?"); \ |
159 | } \ | 159 | } \ |
160 | lseek(fd, 0L, SEEK_SET); \ | 160 | lseek(fd, 0L, SEEK_SET); \ |
161 | if ((local_n = read(fd, buf, sizeof buf - 1)) < 0) { \ | 161 | if ((local_n = read(fd, buf, sizeof buf - 1)) < 0) { \ |
162 | perror_msg_and_die("%s", filename); \ | 162 | bb_perror_msg_and_die("%s", filename); \ |
163 | } \ | 163 | } \ |
164 | buf[local_n] = '\0'; \ | 164 | buf[local_n] = '\0'; \ |
165 | }while(0) | 165 | }while(0) |
@@ -167,7 +167,7 @@ static unsigned long Hertz; | |||
167 | #define FILE_TO_BUF2(filename, fd) do{ \ | 167 | #define FILE_TO_BUF2(filename, fd) do{ \ |
168 | lseek(fd, 0L, SEEK_SET); \ | 168 | lseek(fd, 0L, SEEK_SET); \ |
169 | if ((local_n = read(fd, buf, sizeof buf - 1)) < 0) { \ | 169 | if ((local_n = read(fd, buf, sizeof buf - 1)) < 0) { \ |
170 | perror_msg_and_die("%s", filename); \ | 170 | bb_perror_msg_and_die("%s", filename); \ |
171 | } \ | 171 | } \ |
172 | buf[local_n] = '\0'; \ | 172 | buf[local_n] = '\0'; \ |
173 | }while(0) | 173 | }while(0) |
@@ -313,19 +313,19 @@ static unsigned long display_generic(void) | |||
313 | unsigned long total, used, mfree, shared, buffers, cached; | 313 | unsigned long total, used, mfree, shared, buffers, cached; |
314 | 314 | ||
315 | /* read memory info */ | 315 | /* read memory info */ |
316 | fp = xfopen("meminfo", "r"); | 316 | fp = bb_xfopen("meminfo", "r"); |
317 | fgets(buf, sizeof(buf), fp); /* skip first line */ | 317 | fgets(buf, sizeof(buf), fp); /* skip first line */ |
318 | 318 | ||
319 | if (fscanf(fp, "Mem: %lu %lu %lu %lu %lu %lu", | 319 | if (fscanf(fp, "Mem: %lu %lu %lu %lu %lu %lu", |
320 | &total, &used, &mfree, &shared, &buffers, &cached) != 6) { | 320 | &total, &used, &mfree, &shared, &buffers, &cached) != 6) { |
321 | error_msg_and_die("failed to read '%s'", "meminfo"); | 321 | bb_error_msg_and_die("failed to read '%s'", "meminfo"); |
322 | } | 322 | } |
323 | fclose(fp); | 323 | fclose(fp); |
324 | 324 | ||
325 | /* read load average */ | 325 | /* read load average */ |
326 | fp = xfopen("loadavg", "r"); | 326 | fp = bb_xfopen("loadavg", "r"); |
327 | if (fscanf(fp, "%f %f %f", &avg1, &avg2, &avg3) != 3) { | 327 | if (fscanf(fp, "%f %f %f", &avg1, &avg2, &avg3) != 3) { |
328 | error_msg_and_die("failed to read '%s'", "loadavg"); | 328 | bb_error_msg_and_die("failed to read '%s'", "loadavg"); |
329 | } | 329 | } |
330 | fclose(fp); | 330 | fclose(fp); |
331 | 331 | ||
@@ -447,7 +447,7 @@ int top_main(int argc, char **argv) | |||
447 | interval = atoi(optarg); | 447 | interval = atoi(optarg); |
448 | break; | 448 | break; |
449 | default: | 449 | default: |
450 | show_usage(); | 450 | bb_show_usage(); |
451 | } | 451 | } |
452 | } | 452 | } |
453 | 453 | ||
@@ -461,7 +461,7 @@ int top_main(int argc, char **argv) | |||
461 | #endif | 461 | #endif |
462 | /* change to /proc */ | 462 | /* change to /proc */ |
463 | if (chdir("/proc") < 0) { | 463 | if (chdir("/proc") < 0) { |
464 | perror_msg_and_die("chdir('/proc')"); | 464 | bb_perror_msg_and_die("chdir('/proc')"); |
465 | } | 465 | } |
466 | #if defined CONFIG_FEATURE_USE_TERMIOS | 466 | #if defined CONFIG_FEATURE_USE_TERMIOS |
467 | tcgetattr(0, (void *) &initial_settings); | 467 | tcgetattr(0, (void *) &initial_settings); |
@@ -508,7 +508,7 @@ int top_main(int argc, char **argv) | |||
508 | memcpy(top + n, p, sizeof(procps_status_t)); | 508 | memcpy(top + n, p, sizeof(procps_status_t)); |
509 | } | 509 | } |
510 | if (ntop == 0) { | 510 | if (ntop == 0) { |
511 | perror_msg_and_die("scandir('/proc')"); | 511 | bb_perror_msg_and_die("scandir('/proc')"); |
512 | } | 512 | } |
513 | #ifdef FEATURE_CPU_USAGE_PERCENTAGE | 513 | #ifdef FEATURE_CPU_USAGE_PERCENTAGE |
514 | if(!Hertz) { | 514 | if(!Hertz) { |