X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fexec-ulimit.c;h=37f0b44e19565886820a96d84e89af793f24c1ee;hb=0eb34ea41e1fba993eb58d5b28c275e311db0527;hp=7219a9e04762fc35c29e0795b84288db96c9e078;hpb=29fd9845a8128b8e7f6c3828da14d724f8e748f7;p=util-vserver.git diff --git a/src/exec-ulimit.c b/src/exec-ulimit.c index 7219a9e..37f0b44 100644 --- a/src/exec-ulimit.c +++ b/src/exec-ulimit.c @@ -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,19 +179,29 @@ int main(int argc, char *argv[]) } if (chdir(argv[1])!=-1) { - for (i=0; i