Browse Source

* Disabled watcher on sun as it's ptrace is horrid
* SunOs doesn't seem to have a way to setrlimit on procs, so don't bother


svn: 1921

Bryan Drewery 21 năm trước cách đây
mục cha
commit
a37c3d129a
2 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 3 3
      src/bg.c
  2. 2 0
      src/debug.c

+ 3 - 3
src/bg.c

@@ -27,7 +27,7 @@
 
 time_t lastfork = 0;
 
-#ifndef CYGWIN_HACKS
+#if !defined(CYGWIN_HACKS) && !defined(__sun__)
 pid_t watcher;                  /* my child/watcher */
 
 static void init_watcher(pid_t);
@@ -81,7 +81,7 @@ do_fork()
 
   writepid(conf.bot->pid_file, pid);
   lastfork = now;
-#ifndef CYGWIN_HACKS
+#if !defined(CYGWIN_HACKS) && !defined(__sun__)
   if (conf.watcher)
     init_watcher(pid);
 #endif /* !CYGWIN_HACKS */
@@ -111,7 +111,7 @@ writepid(const char *pidfile, pid_t pid)
     printf(EGG_NOWRITE, pidfile);
 }
 
-#ifndef CYGWIN_HACKS
+#if !defined(CYGWIN_HACKS) && !defined(__sun__)
 static void
 init_watcher(pid_t parent)
 {

+ 2 - 0
src/debug.c

@@ -65,7 +65,9 @@ void setlimits()
   corelim.rlim_max = RLIM_INFINITY;
 #endif /* !DEBUG */
   setrlimit(RLIMIT_CORE, &corelim);
+#ifndef __sun__
   setrlimit(RLIMIT_NPROC, &plim);
+#endif
   fdlim.rlim_cur = 300;
   fdlim.rlim_max = 300;
   setrlimit(RLIMIT_NOFILE, &fdlim);