[uClibc]Job Control on /dev/console
Andrew May
acmay at acmay.homeip.net
Wed Nov 27 18:33:11 UTC 2002
I get the "job control turned off" print when I start a shell on /dev/console,
on my PPC405 system.
The tty command returns /dev/console. I don't know how to set inittab to spawn
off a getty for /dev/console, so I just spawn off a shell.
I think the code below is what does the print, and it does seem strange to
me.
if( initialpgrp < 0 ){
...
return;
}
if( initialpgrp == -1 )
/* never going to get here*/
=====================================================================
static void setjobctl(int enable) {
if (enable == jobctl || rootshell == 0)
return;
if (enable) {
do { /* while we are in the background */
initialpgrp = tcgetpgrp(2);
if (initialpgrp < 0) {
out2str("sh: can't access tty; job control turned off\n");
mflag = 0;
return;
}
if (initialpgrp == -1)
initialpgrp = getpgrp();
else if (initialpgrp != getpgrp()) {
killpg(initialpgrp, SIGTTIN);
continue;
}
} while (0);
More information about the uClibc
mailing list