From e4e2dd0503fdc07973e193414335725570f4238a Mon Sep 17 00:00:00 2001 From: Chris Kuehl Date: Mon, 10 Oct 2016 12:23:19 -0700 Subject: [PATCH] Fix ioctl arguments --- dumb-init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dumb-init.c b/dumb-init.c index 8993d84..65e69ef 100644 --- a/dumb-init.c +++ b/dumb-init.c @@ -252,7 +252,7 @@ int main(int argc, char *argv[]) { signal(i, dummy); /* detach dumb-init from controlling tty */ - if (use_setsid && ioctl(0, TIOCNOTTY, NULL) == -1) { + if (use_setsid && ioctl(STDIN_FILENO, TIOCNOTTY) == -1) { DEBUG( "Unable to detach from controlling tty (errno=%d %s).\n", errno, @@ -277,7 +277,7 @@ int main(int argc, char *argv[]) { exit(1); } - if (ioctl(0, TIOCSCTTY, NULL) == -1) { + if (ioctl(STDIN_FILENO, TIOCSCTTY, 0) == -1) { DEBUG( "Unable to attach to controlling tty (errno=%d %s).\n", errno,