summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-29 10:55:13 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-10-29 10:55:13 +0800
commit8b50c9f882456beb81cfe17ebb2cbc021bd11cb3 (patch)
treec541ff68c98a96e43562961c25b2f67c8520f4eb
parent5120c64156adeaeb18538aafda8c913c96a9ba11 (diff)
downloadpttbbs-8b50c9f882456beb81cfe17ebb2cbc021bd11cb3.tar
pttbbs-8b50c9f882456beb81cfe17ebb2cbc021bd11cb3.tar.gz
pttbbs-8b50c9f882456beb81cfe17ebb2cbc021bd11cb3.tar.bz2
pttbbs-8b50c9f882456beb81cfe17ebb2cbc021bd11cb3.tar.lz
pttbbs-8b50c9f882456beb81cfe17ebb2cbc021bd11cb3.tar.xz
pttbbs-8b50c9f882456beb81cfe17ebb2cbc021bd11cb3.tar.zst
pttbbs-8b50c9f882456beb81cfe17ebb2cbc021bd11cb3.zip
* allow configuring cpu limits for xhcatd in site config file
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5010 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/util/xchatd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pttbbs/util/xchatd.c b/pttbbs/util/xchatd.c
index 3f419f1d..e61869ff 100644
--- a/pttbbs/util/xchatd.c
+++ b/pttbbs/util/xchatd.c
@@ -2653,9 +2653,12 @@ start_daemon()
// its cpu resource may be limited and cause regular restart.
// to workaround this, let's enlarge CPU limit here.
getrlimit(RLIMIT_CPU, &limit);
- limit.rlim_cur = limit.rlim_max;
+# ifndef XCHATD_CPU_LIMITS
+# define XCHATD_CPU_LIMITS limit.rlim_max
+# endif
+ limit.rlim_cur = XCHATD_CPU_LIMITS;
setrlimit(RLIMIT_CPU, &limit);
-#endif
+#endif // !NO_ADJUST_CPU_LIMITS
#ifdef USE_XCHATD_COREDUMP
getrlimit(RLIMIT_CORE, &limit);