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