hrev44775 adds 1 changeset to branch 'master' old head: 662b04ff7d27ad3f07210efd527d9d99bda4b538 new head: 553b6b21235665b1e70bb744a5ad37c36d01569f ---------------------------------------------------------------------------- 553b6b2: Fix gcc2 build along with some (minor) style issues [ John Scipione <jscipione@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev44775 Commit: 553b6b21235665b1e70bb744a5ad37c36d01569f URL: http://cgit.haiku-os.org/haiku/commit/?id=553b6b2 Author: John Scipione <jscipione@xxxxxxxxx> Date: Tue Nov 6 05:45:53 2012 UTC ---------------------------------------------------------------------------- 1 file changed, 17 insertions(+), 15 deletions(-) src/bin/listsem.c | 32 +++++++++++++++++--------------- ---------------------------------------------------------------------------- diff --git a/src/bin/listsem.c b/src/bin/listsem.c index 8440eb3..d066fcb 100644 --- a/src/bin/listsem.c +++ b/src/bin/listsem.c @@ -85,29 +85,31 @@ int main(int argc, char **argv) } for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) { + if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) { fprintf(stderr, "Usage: %s [-s semid] [teamid]\n", argv[0]); - fputs(" List the semaphores allocated by the specified\n", stderr); - fputs(" team, or all teams if none is specified.\n", stderr); + fputs(" List the semaphores allocated by the specified\n", + stderr); + fputs(" team, or all teams if none is specified.\n", + stderr); fputs("\n", stderr); - fputs(" The -s option displays the sem_info data for a\n", stderr); + fputs(" The -s option displays the sem_info data for a\n", + stderr); fputs(" specified semaphore.\n", stderr); return 0; - } else if (!strcmp(argv[i], "-s")) { + } else if (strcmp(argv[i], "-s") == 0) { if (argc < i + 2) printf("-s used without associated sem id\n"); else { - sem_id sem = atoi(argv[i+1]); - + sem_id id = atoi(argv[i + 1]); + sem_info info; + if (get_sem_info(id, &info) == B_OK) { + print_header(NULL); + print_sem_info(&info); + } else + printf("semaphore %ld unknown\n\n", id); + + i++; } - int semID = atoi(argv[i+1]); - sem_info info; - if (get_sem_info(semID, &info) == B_OK) { - print_header(NULL); - print_sem_info(&info); - } else - printf("semaphore %ld unknown\n\n", semID); - i++; } else { team_id team; team = atoi(argv[i]);