Skip to content

Commit

Permalink
init: Don't perform ioctl (TIOCSCTTY).
Browse files Browse the repository at this point in the history
Doing this breaks bash in virt-rescue with the error:

  bash: cannot set terminal process group (-1): Inappropriate ioctl for device
  bash: no job control in this shell

Also ^C etc does not work.

Removing this ioctl call fixes this.

I noticed the problem because supermin's init compiled with dietlibc
worked, since the dietlibc header files don't define TIOCSCTTY and
hence the ioctl was not called.
  • Loading branch information
rwmjones committed Apr 3, 2017
1 parent cf2b94d commit ec0ec99
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions init/init.c
Expand Up @@ -240,10 +240,6 @@ main ()

/* Make current process the controlling process of the tty. */
setsid ();
#ifdef TIOCSCTTY
if (ioctl (0, TIOCSCTTY, 1) == -1)
perror ("ioctl: TIOCSCTTY");
#endif

if (!quiet)
fprintf (stderr, "supermin: creating /dev/root as block special %d:%d\n",
Expand Down

0 comments on commit ec0ec99

Please sign in to comment.