aboutsummaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-06 09:49:47 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-10-06 09:49:47 +0000
commit0c25765dadfc6f92e0c90f146df6b018025d4c62 (patch)
tree17df4dd427d85319857d9b7882585b3db9ad6994 /runit
parentc51bc4078de3529829b4ee0c20ed490af680c40d (diff)
downloadbusybox-w32-0c25765dadfc6f92e0c90f146df6b018025d4c62.tar.gz
busybox-w32-0c25765dadfc6f92e0c90f146df6b018025d4c62.tar.bz2
busybox-w32-0c25765dadfc6f92e0c90f146df6b018025d4c62.zip
dnsd fix; option_mask32 added. dnsd needs more love.
git-svn-id: svn://busybox.net/trunk/busybox@16316 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'runit')
-rw-r--r--runit/chpst.c73
1 files changed, 36 insertions, 37 deletions
diff --git a/runit/chpst.c b/runit/chpst.c
index b26d62866..4c44e3c0c 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -2,13 +2,12 @@
2 2
3#include <dirent.h> 3#include <dirent.h>
4 4
5static unsigned option_mask;
6// Must match constants in chpst_main! 5// Must match constants in chpst_main!
7#define OPT_verbose (option_mask & 0x2000) 6#define OPT_verbose (option_mask32 & 0x2000)
8#define OPT_pgrp (option_mask & 0x4000) 7#define OPT_pgrp (option_mask32 & 0x4000)
9#define OPT_nostdin (option_mask & 0x8000) 8#define OPT_nostdin (option_mask32 & 0x8000)
10#define OPT_nostdout (option_mask & 0x10000) 9#define OPT_nostdout (option_mask32 & 0x10000)
11#define OPT_nostderr (option_mask & 0x20000) 10#define OPT_nostderr (option_mask32 & 0x20000)
12 11
13static char *set_user; 12static char *set_user;
14static char *env_user; 13static char *env_user;
@@ -224,28 +223,28 @@ int chpst_main(int argc, char **argv)
224 223
225 { 224 {
226 char *m,*d,*o,*p,*f,*c,*r,*t,*n; 225 char *m,*d,*o,*p,*f,*c,*r,*t,*n;
227 option_mask = getopt32(argc, argv, "u:U:e:m:d:o:p:f:c:r:t:/:n:vP012", 226 getopt32(argc, argv, "u:U:e:m:d:o:p:f:c:r:t:/:n:vP012",
228 &set_user,&env_user,&env_dir, 227 &set_user,&env_user,&env_dir,
229 &m,&d,&o,&p,&f,&c,&r,&t,&root,&n); 228 &m,&d,&o,&p,&f,&c,&r,&t,&root,&n);
230 // if (option_mask & 0x1) // -u 229 // if (option_mask32 & 0x1) // -u
231 // if (option_mask & 0x2) // -U 230 // if (option_mask32 & 0x2) // -U
232 // if (option_mask & 0x4) // -e 231 // if (option_mask32 & 0x4) // -e
233 if (option_mask & 0x8) limits = limitl = limita = limitd = bb_xgetularg10(m); // -m 232 if (option_mask32 & 0x8) limits = limitl = limita = limitd = bb_xgetularg10(m); // -m
234 if (option_mask & 0x10) limitd = bb_xgetularg10(d); // -d 233 if (option_mask32 & 0x10) limitd = bb_xgetularg10(d); // -d
235 if (option_mask & 0x20) limito = bb_xgetularg10(o); // -o 234 if (option_mask32 & 0x20) limito = bb_xgetularg10(o); // -o
236 if (option_mask & 0x40) limitp = bb_xgetularg10(p); // -p 235 if (option_mask32 & 0x40) limitp = bb_xgetularg10(p); // -p
237 if (option_mask & 0x80) limitf = bb_xgetularg10(f); // -f 236 if (option_mask32 & 0x80) limitf = bb_xgetularg10(f); // -f
238 if (option_mask & 0x100) limitc = bb_xgetularg10(c); // -c 237 if (option_mask32 & 0x100) limitc = bb_xgetularg10(c); // -c
239 if (option_mask & 0x200) limitr = bb_xgetularg10(r); // -r 238 if (option_mask32 & 0x200) limitr = bb_xgetularg10(r); // -r
240 if (option_mask & 0x400) limitt = bb_xgetularg10(t); // -t 239 if (option_mask32 & 0x400) limitt = bb_xgetularg10(t); // -t
241 // if (option_mask & 0x800) // -/ 240 // if (option_mask32 & 0x800) // -/
242 if (option_mask & 0x1000) nicelvl = bb_xgetlarg_bnd_sfx(n, 10, -20, 20, NULL); // -n 241 if (option_mask32 & 0x1000) nicelvl = bb_xgetlarg_bnd_sfx(n, 10, -20, 20, NULL); // -n
243 // The below consts should match #defines at top! 242 // The below consts should match #defines at top!
244 //if (option_mask & 0x2000) OPT_verbose = 1; // -v 243 //if (option_mask32 & 0x2000) OPT_verbose = 1; // -v
245 //if (option_mask & 0x4000) OPT_pgrp = 1; // -P 244 //if (option_mask32 & 0x4000) OPT_pgrp = 1; // -P
246 //if (option_mask & 0x8000) OPT_nostdin = 1; // -0 245 //if (option_mask32 & 0x8000) OPT_nostdin = 1; // -0
247 //if (option_mask & 0x10000) OPT_nostdout = 1; // -1 246 //if (option_mask32 & 0x10000) OPT_nostdout = 1; // -1
248 //if (option_mask & 0x20000) OPT_nostderr = 1; // -2 247 //if (option_mask32 & 0x20000) OPT_nostderr = 1; // -2
249 } 248 }
250 argv += optind; 249 argv += optind;
251 if (!argv || !*argv) bb_show_usage(); 250 if (!argv || !*argv) bb_show_usage();
@@ -311,19 +310,19 @@ static void envdir(int argc, char **argv)
311static void softlimit(int argc, char **argv) 310static void softlimit(int argc, char **argv)
312{ 311{
313 char *a,*c,*d,*f,*l,*m,*o,*p,*r,*s,*t; 312 char *a,*c,*d,*f,*l,*m,*o,*p,*r,*s,*t;
314 option_mask = getopt32(argc, argv, "a:c:d:f:l:m:o:p:r:s:t:", 313 getopt32(argc, argv, "a:c:d:f:l:m:o:p:r:s:t:",
315 &a,&c,&d,&f,&l,&m,&o,&p,&r,&s,&t); 314 &a,&c,&d,&f,&l,&m,&o,&p,&r,&s,&t);
316 if (option_mask & 0x001) limita = bb_xgetularg10(a); // -a 315 if (option_mask32 & 0x001) limita = bb_xgetularg10(a); // -a
317 if (option_mask & 0x002) limitc = bb_xgetularg10(c); // -c 316 if (option_mask32 & 0x002) limitc = bb_xgetularg10(c); // -c
318 if (option_mask & 0x004) limitd = bb_xgetularg10(d); // -d 317 if (option_mask32 & 0x004) limitd = bb_xgetularg10(d); // -d
319 if (option_mask & 0x008) limitf = bb_xgetularg10(f); // -f 318 if (option_mask32 & 0x008) limitf = bb_xgetularg10(f); // -f
320 if (option_mask & 0x010) limitl = bb_xgetularg10(l); // -l 319 if (option_mask32 & 0x010) limitl = bb_xgetularg10(l); // -l
321 if (option_mask & 0x020) limits = limitl = limita = limitd = bb_xgetularg10(m); // -m 320 if (option_mask32 & 0x020) limits = limitl = limita = limitd = bb_xgetularg10(m); // -m
322 if (option_mask & 0x040) limito = bb_xgetularg10(o); // -o 321 if (option_mask32 & 0x040) limito = bb_xgetularg10(o); // -o
323 if (option_mask & 0x080) limitp = bb_xgetularg10(p); // -p 322 if (option_mask32 & 0x080) limitp = bb_xgetularg10(p); // -p
324 if (option_mask & 0x100) limitr = bb_xgetularg10(r); // -r 323 if (option_mask32 & 0x100) limitr = bb_xgetularg10(r); // -r
325 if (option_mask & 0x200) limits = bb_xgetularg10(s); // -s 324 if (option_mask32 & 0x200) limits = bb_xgetularg10(s); // -s
326 if (option_mask & 0x400) limitt = bb_xgetularg10(t); // -t 325 if (option_mask32 & 0x400) limitt = bb_xgetularg10(t); // -t
327 argv += optind; 326 argv += optind;
328 if (!argv[0]) bb_show_usage(); 327 if (!argv[0]) bb_show_usage();
329 slimit(); 328 slimit();