Author: sebor
Date: Thu Sep 14 14:55:29 2006
New Revision: 443494
URL: http://svn.apache.org/viewvc?view=rev&rev=443494
Log:
2006-09-14 Andrew Black <[EMAIL PROTECTED]>
* cmdopt.cpp (RLIM_INFINITY, RLIM_SAVED_CUR, RLIM_SAVED_MAX): Move
fallback definitions to...
* cmdopt.h (RLIM_INFINITY, RLIM_SAVED_CUR, RLIM_SAVED_MAX): ... Here.
* exec.cpp (limit_process) [!_WIN32 && !_WIN64 && _XOPEN_UNIX]: Check
limits prior to setting.
Modified:
incubator/stdcxx/trunk/util/cmdopt.cpp
incubator/stdcxx/trunk/util/cmdopt.h
incubator/stdcxx/trunk/util/exec.cpp
Modified: incubator/stdcxx/trunk/util/cmdopt.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/cmdopt.cpp?view=diff&rev=443494&r1=443493&r2=443494
==============================================================================
--- incubator/stdcxx/trunk/util/cmdopt.cpp (original)
+++ incubator/stdcxx/trunk/util/cmdopt.cpp Thu Sep 14 14:55:29 2006
@@ -71,17 +71,6 @@
const size_t exe_suffix_len = 4; /* strlen(".exe") == 4 */
#endif
-#ifndef RLIM_INFINITY
-# define RLIM_INFINITY -1
-#endif /* RLIM_INFINITY */
-
-#ifndef RLIM_SAVED_CUR
-# define RLIM_SAVED_CUR RLIM_INFINITY
-#endif /* RLIM_SAVED_CUR */
-
-#ifndef RLIM_SAVED_MAX
-# define RLIM_SAVED_MAX RLIM_INFINITY
-#endif /* RLIM_SAVED_MAX */
struct limit_set child_limits = {
{ RLIM_SAVED_CUR, RLIM_SAVED_MAX },
{ RLIM_SAVED_CUR, RLIM_SAVED_MAX },
Modified: incubator/stdcxx/trunk/util/cmdopt.h
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/cmdopt.h?view=diff&rev=443494&r1=443493&r2=443494
==============================================================================
--- incubator/stdcxx/trunk/util/cmdopt.h (original)
+++ incubator/stdcxx/trunk/util/cmdopt.h Thu Sep 14 14:55:29 2006
@@ -67,6 +67,18 @@
typedef struct rw_rlimit rw_rlimit;
#endif
+#ifndef RLIM_INFINITY
+# define RLIM_INFINITY -1
+#endif /* RLIM_INFINITY */
+
+#ifndef RLIM_SAVED_CUR
+# define RLIM_SAVED_CUR RLIM_INFINITY
+#endif /* RLIM_SAVED_CUR */
+
+#ifndef RLIM_SAVED_MAX
+# define RLIM_SAVED_MAX RLIM_INFINITY
+#endif /* RLIM_SAVED_MAX */
+
extern struct limit_set {
rw_rlimit core;
rw_rlimit cpu;
Modified: incubator/stdcxx/trunk/util/exec.cpp
URL:
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/exec.cpp?view=diff&rev=443494&r1=443493&r2=443494
==============================================================================
--- incubator/stdcxx/trunk/util/exec.cpp (original)
+++ incubator/stdcxx/trunk/util/exec.cpp Thu Sep 14 14:55:29 2006
@@ -681,6 +681,10 @@
for (size_t i = 0; limits [i].limit; ++i) {
rw_rlimit local;
+ if ( RLIM_SAVED_CUR == limits [i].limit->rlim_cur
+ && RLIM_SAVED_MAX == limits [i].limit->rlim_max )
+ continue;
+
memcpy (&local, limits [i].limit, sizeof (struct rlimit));
if (setrlimit (limits [i].resource, &local)) {