X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fexec-ulimit.c;h=444a7f067e50bdb6e557412a595fc78adea10dc9;hb=ec4370f7ebd7fb0ce7f002f5bf2c74f03acd3ec1;hp=510e5d0456abd53975f48f6cf9533831a4918070;hpb=9234e6a7cb48373edec38284ba54a819037b79b2;p=util-vserver.git diff --git a/src/exec-ulimit.c b/src/exec-ulimit.c index 510e5d0..444a7f0 100644 --- a/src/exec-ulimit.c +++ b/src/exec-ulimit.c @@ -1,4 +1,4 @@ -// $Id: exec-ulimit.c,v 1.7 2004/05/08 01:40:25 ensc Exp $ --*- c -*-- +// $Id: exec-ulimit.c 2371 2006-11-05 17:46:33Z dhozac $ --*- c -*-- // Copyright (C) 2003 Enrico Scholz // @@ -34,6 +34,13 @@ #define ENSC_WRAPPERS_RESOURCE 1 #include +/* dietlibc specifies this as (~0UL>>1), which is what's returned from + * sys_old_getrlimit, called on some arches for getrlimit. + * Reset it here so the kernel will have the correct values when we set it. */ +#undef RLIM_INFINITY +#define RLIM_INFINITY (~0UL) +#define OLD_RLIM_INFINITY (~0UL>>1) + #define DECLARE_LIMIT(RES,FNAME) { #FNAME, RLIMIT_##RES } int wrapper_exit_code = 255; @@ -159,6 +166,7 @@ int main(int argc, char *argv[]) { size_t i; int cur_fd = Eopen(".", O_RDONLY, 0); + bool in_dir = false; if (argc==2) { if (strcmp(argv[1], "--help")==0) showHelp(1,argv[0],0); @@ -171,15 +179,29 @@ int main(int argc, char *argv[]) } if (chdir(argv[1])!=-1) { - for (i=0; i