summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-10-28 17:10:46 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2010-10-28 17:10:46 (GMT)
commit756e95e7822182f0bb75fc33284123c9b73f3d8f (patch)
tree7c8a52e6dbe4cf14acf85252eae96f910bb67e0f
parente4dcba1c103dc28e927e004791e331aaf604383d (diff)
downloadbusybox-756e95e7822182f0bb75fc33284123c9b73f3d8f.tar.gz
busybox-756e95e7822182f0bb75fc33284123c9b73f3d8f.tar.bz2
ipcrm: small code shrink
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--util-linux/ipcrm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c
index 731216c..e597ed6 100644
--- a/util-linux/ipcrm.c
+++ b/util-linux/ipcrm.c
@@ -40,7 +40,7 @@ typedef enum type_id {
MSG
} type_id;
-static int remove_ids(type_id type, int argc, char **argv)
+static int remove_ids(type_id type, char **argv)
{
unsigned long id;
int nb_errors = 0;
@@ -48,7 +48,7 @@ static int remove_ids(type_id type, int argc, char **argv)
arg.val = 0;
- while (argc) {
+ while (argv[0]) {
id = bb_strtoul(argv[0], NULL, 10);
if (errno || id > INT_MAX) {
bb_error_msg("invalid id: %s", argv[0]);
@@ -67,7 +67,6 @@ static int remove_ids(type_id type, int argc, char **argv)
nb_errors++;
}
}
- argc--;
argv++;
}
@@ -109,7 +108,7 @@ int ipcrm_main(int argc, char **argv)
else if (w == 'e')
what = SEM;
- if (remove_ids(what, argc-2, &argv[2]))
+ if (remove_ids(what, &argv[2]))
fflush_stdout_and_exit(EXIT_FAILURE);
printf("resource(s) deleted\n");
return 0;