Skip to content

Commit

Permalink
Fix ioctl arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskuehl committed Oct 10, 2016
1 parent fff4226 commit e4e2dd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dumb-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit e4e2dd0

Please sign in to comment.