diff options
author | Gerrit Pape <pape@smarden.org> | 2005-07-23 12:49:47 +0000 |
---|---|---|
committer | Gerrit Pape <pape@smarden.org> | 2005-07-23 12:49:47 +0000 |
commit | 8ef856eff7a3e73d7df7784aacbcd53c0e871b0e (patch) | |
tree | e4121218d860ac3cd246275ce1e103e0fbf2df5c | |
parent | 6d5f2c4629341bed4dcfc3ef975559889ac432c8 (diff) | |
download | runit-8ef856eff7a3e73d7df7784aacbcd53c0e871b0e.tar.gz runit-8ef856eff7a3e73d7df7784aacbcd53c0e871b0e.tar.xz runit-8ef856eff7a3e73d7df7784aacbcd53c0e871b0e.zip |
* chpst.c: fix pointer types.
-rw-r--r-- | package/CHANGES | 1 | ||||
-rw-r--r-- | src/chpst.c | 28 |
2 files changed, 17 insertions, 12 deletions
diff --git a/package/CHANGES b/package/CHANGES index c0013a3..b9fb21a 100644 --- a/package/CHANGES +++ b/package/CHANGES @@ -16,6 +16,7 @@ runit 1.2.6 * sv.c: new sv program to control services, optionally can be linked to /etc/init.d/ as lsb "init script" command line interface. * Makefile, TARGETS: adapt. + * chpst.c: fix pointer types. runit 1.2.3 Mon, 18 Apr 2005 17:08:35 +0000 diff --git a/src/chpst.c b/src/chpst.c index a6f474e..cbf34eb 100644 --- a/src/chpst.c +++ b/src/chpst.c @@ -255,6 +255,7 @@ void softlimit(int, const char *const *); int main(int argc, const char *const *argv) { int opt; int i; + unsigned long ul; progname =argv[0]; for (i =str_len(progname); i; --i) @@ -279,25 +280,25 @@ int main(int argc, const char *const *argv) { case 'U': env_user =(char*)optarg; break; case 'e': env_dir =optarg; break; case 'm': - if (optarg[scan_ulong(optarg, &limitd)]) usage(); - limits =limitl =limita =limitd; + if (optarg[scan_ulong(optarg, &ul)]) usage(); + limits =limitl =limita =limitd =ul; break; - case 'o': if (optarg[scan_ulong(optarg, &limito)]) usage(); break; - case 'p': if (optarg[scan_ulong(optarg, &limitp)]) usage(); break; - case 'f': if (optarg[scan_ulong(optarg, &limitf)]) usage(); break; - case 'c': if (optarg[scan_ulong(optarg, &limitc)]) usage(); break; - case 'r': if (optarg[scan_ulong(optarg, &limitr)]) usage(); break; - case 't': if (optarg[scan_ulong(optarg, &limitt)]) usage(); break; + case 'o': if (optarg[scan_ulong(optarg, &ul)]) usage(); limito =ul; break; + case 'p': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitp =ul; break; + case 'f': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitf =ul; break; + case 'c': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitc =ul; break; + case 'r': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitr =ul; break; + case 't': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitt =ul; break; case '/': root =optarg; break; case 'n': switch (*optarg) { case '-': - if (optarg[scan_ulong(++optarg, &nicelvl)]) usage(); + if (optarg[scan_ulong(++optarg, &ul)]) usage(); nicelvl =ul; nicelvl *=-1; break; case '+': ++optarg; default: - if (optarg[scan_ulong(optarg, &nicelvl)]) usage(); + if (optarg[scan_ulong(optarg, &ul)]) usage(); nicelvl =ul; break; } break; @@ -419,12 +420,15 @@ void setlock(int argc, const char *const *argv) { } void softlimit(int argc, const char *const *argv) { int opt; + unsigned long ul; + void usage() { strerr_die4x(100, "usage: ", progname, USAGE_SOFTLIMIT, "\n"); } void getlarg(long *l) { - if (str_equal(optarg, "=")) *l =-1; - else if (optarg[scan_ulong(optarg, l)]) usage(); + if (str_equal(optarg, "=")) { *l =-1; return; } + if (optarg[scan_ulong(optarg, &ul)]) usage(); + *l =ul; } while ((opt =getopt(argc,argv,"a:c:d:f:l:m:o:p:r:s:t:")) != opteof) |