aboutsummaryrefslogtreecommitdiff
path: root/util-linux/ipcs.c
diff options
context:
space:
mode:
authorTim Riker <tim@rikers.org>2006-01-25 00:08:53 +0000
committerTim Riker <tim@rikers.org>2006-01-25 00:08:53 +0000
commitc1ef7bdd8d002ae0889efcf883d0e1b7faa938d4 (patch)
tree5f329b7d0c7f20ecced0dc7581a9ba6dc720d965 /util-linux/ipcs.c
parentf64ff682a3d58dbb627e760e6fe1ec21d9ccdf61 (diff)
downloadbusybox-w32-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.tar.gz
busybox-w32-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.tar.bz2
busybox-w32-c1ef7bdd8d002ae0889efcf883d0e1b7faa938d4.zip
just whitespace
Diffstat (limited to 'util-linux/ipcs.c')
-rw-r--r--util-linux/ipcs.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c
index ea5e412ea..f1463a8e3 100644
--- a/util-linux/ipcs.c
+++ b/util-linux/ipcs.c
@@ -29,12 +29,12 @@
29 * 19:30:41 1996 by janl@math.uio.no to add code missing in case PID: 29 * 19:30:41 1996 by janl@math.uio.no to add code missing in case PID:
30 * clauses. 30 * clauses.
31 * 31 *
32 * Patches from Mike Jagdis (jaggy@purplet.demon.co.uk) applied 32 * Patches from Mike Jagdis (jaggy@purplet.demon.co.uk) applied
33 * Wed Feb 8 12:12:21 1995 by faith@cs.unc.edu to print numeric uids 33 * Wed Feb 8 12:12:21 1995 by faith@cs.unc.edu to print numeric uids
34 * if no passwd file entry. 34 * if no passwd file entry.
35 * 35 *
36 * Modified Sat Oct 9 10:55:28 1993 for 0.99.13 36 * Modified Sat Oct 9 10:55:28 1993 for 0.99.13
37 * Original author unknown, may be "krishna balasub@cis.ohio-state.edu" 37 * Original author unknown, may be "krishna balasub@cis.ohio-state.edu"
38 * 38 *
39 */ 39 */
40 40
@@ -136,7 +136,7 @@ static void print_msg (int id);
136static void print_sem (int id); 136static void print_sem (int id);
137 137
138int ipcs_main (int argc, char **argv) { 138int ipcs_main (int argc, char **argv) {
139 int opt, msg = 0, sem = 0, shm = 0, id=0, print=0; 139 int opt, msg = 0, sem = 0, shm = 0, id=0, print=0;
140 char format = 0; 140 char format = 0;
141 char options[] = "atclupsmqi:ih?"; 141 char options[] = "atclupsmqi:ih?";
142 142
@@ -173,7 +173,7 @@ int ipcs_main (int argc, char **argv) {
173 case 'u': 173 case 'u':
174 format = STATUS; 174 format = STATUS;
175 break; 175 break;
176 case 'h': 176 case 'h':
177 case '?': 177 case '?':
178 bb_show_usage(); 178 bb_show_usage();
179 bb_fflush_stdout_and_exit (0); 179 bb_fflush_stdout_and_exit (0);
@@ -181,11 +181,11 @@ int ipcs_main (int argc, char **argv) {
181 } 181 }
182 182
183 if (print) { 183 if (print) {
184 if (shm) { 184 if (shm) {
185 print_shm (id); 185 print_shm (id);
186 bb_fflush_stdout_and_exit (0); 186 bb_fflush_stdout_and_exit (0);
187 } 187 }
188 if (sem) { 188 if (sem) {
189 print_sem (id); 189 print_sem (id);
190 bb_fflush_stdout_and_exit (0); 190 bb_fflush_stdout_and_exit (0);
191 } 191 }
@@ -201,15 +201,15 @@ int ipcs_main (int argc, char **argv) {
201 msg = sem = shm = 1; 201 msg = sem = shm = 1;
202 bb_printf ("\n"); 202 bb_printf ("\n");
203 203
204 if (shm) { 204 if (shm) {
205 do_shm (format); 205 do_shm (format);
206 bb_printf ("\n"); 206 bb_printf ("\n");
207 } 207 }
208 if (sem) { 208 if (sem) {
209 do_sem (format); 209 do_sem (format);
210 bb_printf ("\n"); 210 bb_printf ("\n");
211 } 211 }
212 if (msg) { 212 if (msg) {
213 do_msg (format); 213 do_msg (format);
214 bb_printf ("\n"); 214 bb_printf ("\n");
215 } 215 }
@@ -258,7 +258,7 @@ void do_shm (char format)
258 bb_printf ("kernel not configured for shared memory\n"); 258 bb_printf ("kernel not configured for shared memory\n");
259 return; 259 return;
260 } 260 }
261 261
262 switch (format) { 262 switch (format) {
263 case LIMITS: 263 case LIMITS:
264 bb_printf ("------ Shared Memory Limits --------\n"); 264 bb_printf ("------ Shared Memory Limits --------\n");
@@ -282,7 +282,7 @@ void do_shm (char format)
282 bb_printf ("pages allocated %ld\n", shm_info.shm_tot); 282 bb_printf ("pages allocated %ld\n", shm_info.shm_tot);
283 bb_printf ("pages resident %ld\n", shm_info.shm_rss); 283 bb_printf ("pages resident %ld\n", shm_info.shm_rss);
284 bb_printf ("pages swapped %ld\n", shm_info.shm_swp); 284 bb_printf ("pages swapped %ld\n", shm_info.shm_swp);
285 bb_printf ("Swap performance: %ld attempts\t %ld successes\n", 285 bb_printf ("Swap performance: %ld attempts\t %ld successes\n",
286 shm_info.swap_attempts, shm_info.swap_successes); 286 shm_info.swap_attempts, shm_info.swap_successes);
287 return; 287 return;
288 288
@@ -313,7 +313,7 @@ void do_shm (char format)
313 313
314 for (id = 0; id <= maxid; id++) { 314 for (id = 0; id <= maxid; id++) {
315 shmid = shmctl (id, SHM_STAT, &shmseg); 315 shmid = shmctl (id, SHM_STAT, &shmseg);
316 if (shmid < 0) 316 if (shmid < 0)
317 continue; 317 continue;
318 if (format == CREATOR) { 318 if (format == CREATOR) {
319 print_perms (shmid, ipcp); 319 print_perms (shmid, ipcp);
@@ -321,7 +321,7 @@ void do_shm (char format)
321 } 321 }
322 pw = getpwuid(ipcp->uid); 322 pw = getpwuid(ipcp->uid);
323 switch (format) { 323 switch (format) {
324 case TIME: 324 case TIME:
325 if (pw) 325 if (pw)
326 bb_printf ("%-10d %-10.10s", shmid, pw->pw_name); 326 bb_printf ("%-10d %-10.10s", shmid, pw->pw_name);
327 else 327 else
@@ -342,14 +342,14 @@ void do_shm (char format)
342 bb_printf (" %-10d %-10d\n", 342 bb_printf (" %-10d %-10d\n",
343 shmseg.shm_cpid, shmseg.shm_lpid); 343 shmseg.shm_cpid, shmseg.shm_lpid);
344 break; 344 break;
345 345
346 default: 346 default:
347 bb_printf("0x%08x ",ipcp->KEY ); 347 bb_printf("0x%08x ",ipcp->KEY );
348 if (pw) 348 if (pw)
349 bb_printf ("%-10d %-10.10s", shmid, pw->pw_name); 349 bb_printf ("%-10d %-10.10s", shmid, pw->pw_name);
350 else 350 else
351 bb_printf ("%-10d %-10d", shmid, ipcp->uid); 351 bb_printf ("%-10d %-10d", shmid, ipcp->uid);
352 bb_printf ("%-10o %-10lu %-10ld %-6s %-6s\n", 352 bb_printf ("%-10o %-10lu %-10ld %-6s %-6s\n",
353 ipcp->mode & 0777, 353 ipcp->mode & 0777,
354 /* 354 /*
355 * earlier: int, Austin has size_t 355 * earlier: int, Austin has size_t
@@ -384,7 +384,7 @@ void do_sem (char format)
384 bb_printf ("kernel not configured for semaphores\n"); 384 bb_printf ("kernel not configured for semaphores\n");
385 return; 385 return;
386 } 386 }
387 387
388 switch (format) { 388 switch (format) {
389 case LIMITS: 389 case LIMITS:
390 bb_printf ("------ Semaphore Limits --------\n"); 390 bb_printf ("------ Semaphore Limits --------\n");
@@ -421,7 +421,7 @@ void do_sem (char format)
421 421
422 default: 422 default:
423 bb_printf ("------ Semaphore Arrays --------\n"); 423 bb_printf ("------ Semaphore Arrays --------\n");
424 bb_printf ("%-10s %-10s %-10s %-10s %-10s\n", 424 bb_printf ("%-10s %-10s %-10s %-10s %-10s\n",
425 "key","semid","owner","perms","nsems"); 425 "key","semid","owner","perms","nsems");
426 break; 426 break;
427 } 427 }
@@ -437,7 +437,7 @@ void do_sem (char format)
437 } 437 }
438 pw = getpwuid(ipcp->uid); 438 pw = getpwuid(ipcp->uid);
439 switch (format) { 439 switch (format) {
440 case TIME: 440 case TIME:
441 if (pw) 441 if (pw)
442 bb_printf ("%-8d %-10.10s", semid, pw->pw_name); 442 bb_printf ("%-8d %-10.10s", semid, pw->pw_name);
443 else 443 else
@@ -449,7 +449,7 @@ void do_sem (char format)
449 break; 449 break;
450 case PID: 450 case PID:
451 break; 451 break;
452 452
453 default: 453 default:
454 bb_printf("0x%08x ", ipcp->KEY); 454 bb_printf("0x%08x ", ipcp->KEY);
455 if (pw) 455 if (pw)
@@ -484,7 +484,7 @@ void do_msg (char format)
484 bb_printf ("kernel not configured for message queues\n"); 484 bb_printf ("kernel not configured for message queues\n");
485 return; 485 return;
486 } 486 }
487 487
488 switch (format) { 488 switch (format) {
489 case LIMITS: 489 case LIMITS:
490 if ((msgctl (0, IPC_INFO, (struct msqid_ds *) (void *) &msginfo)) < 0 ) 490 if ((msgctl (0, IPC_INFO, (struct msqid_ds *) (void *) &msginfo)) < 0 )
@@ -662,7 +662,7 @@ void print_sem (int semid)
662 bb_printf ("nsems = %ld\n", (long) semds.sem_nsems); 662 bb_printf ("nsems = %ld\n", (long) semds.sem_nsems);
663 bb_printf ("otime = %-26.24s\n", 663 bb_printf ("otime = %-26.24s\n",
664 semds.sem_otime ? ctime (&semds.sem_otime) : "Not set"); 664 semds.sem_otime ? ctime (&semds.sem_otime) : "Not set");
665 bb_printf ("ctime = %-26.24s\n", ctime (&semds.sem_ctime)); 665 bb_printf ("ctime = %-26.24s\n", ctime (&semds.sem_ctime));
666 666
667 bb_printf ("%-10s %-10s %-10s %-10s %-10s\n", 667 bb_printf ("%-10s %-10s %-10s %-10s %-10s\n",
668 "semnum","value","ncount","zcount","pid"); 668 "semnum","value","ncount","zcount","pid");