1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

process.c: rb_daemon should not raise

* process.c (rb_daemon): should not raise exceptions, since
  proc_daemon() will deal with errors.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-01 03:14:55 +00:00
parent 93f8341792
commit cdce1dd4ef

View file

@ -5676,26 +5676,19 @@ rb_daemon(int nochdir, int noclose)
#else #else
int n; int n;
switch (rb_fork_ruby(NULL)) { #define fork_daemon() \
case -1: switch (rb_fork_ruby(NULL)) { \
rb_sys_fail("daemon"); case -1: return -1; \
case 0: case 0: break; \
break; default: _exit(EXIT_SUCCESS); \
default:
_exit(EXIT_SUCCESS);
} }
proc_setsid(); fork_daemon();
if (setsid() < 0) return -1;
/* must not be process-leader */ /* must not be process-leader */
switch (rb_fork_ruby(NULL)) { fork_daemon();
case -1:
return -1;
case 0:
break;
default:
_exit(EXIT_SUCCESS);
}
if (!nochdir) if (!nochdir)
err = chdir("/"); err = chdir("/");