setpgid() can return EPERM if we are already a process group leader.

This commit is contained in:
Nicholas J. Kain 2014-04-15 15:02:20 -04:00
parent e5834da6d3
commit 730e5ef310

View File

@ -485,8 +485,11 @@ int main(int argc, char *argv[])
default: suicide("failed to set the interface to up state");
}
if (setpgid(0, 0) < 0)
suicide("setpgid failed: %s", strerror(errno));
if (setpgid(0, 0) < 0) {
// EPERM is returned if we are already a process group leader.
if (errno != EPERM)
suicide("setpgid failed: %s", strerror(errno));
}
spawn_ifch();
spawn_sockd();