Magellan Linux

Diff of /trunk/mkinitrd-magellan/klibc/usr/dash/jobs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 814 by niro, Sat Sep 1 22:45:15 2007 UTC revision 815 by niro, Fri Apr 24 18:32:46 2009 UTC
# Line 188  setjobctl(int on) Line 188  setjobctl(int on)
188   if (on == jobctl || rootshell == 0)   if (on == jobctl || rootshell == 0)
189   return;   return;
190   if (on) {   if (on) {
191   int ofd;   fd = open(_PATH_TTY, O_RDWR);
  ofd = fd = open(_PATH_TTY, O_RDWR);  
192   if (fd < 0) {   if (fd < 0) {
193   fd += 3;   fd += 3;
194   while (!isatty(fd) && --fd >= 0)   while (!isatty(fd))
195   ;   if (--fd < 0)
196     goto out;
197   }   }
198   fd = fcntl(fd, F_DUPFD, 10);   fd = savefd(fd);
  close(ofd);  
  if (fd < 0)  
  goto out;  
  fcntl(fd, F_SETFD, FD_CLOEXEC);  
199   do { /* while we are in the background */   do { /* while we are in the background */
200   if ((pgrp = tcgetpgrp(fd)) < 0) {   if ((pgrp = tcgetpgrp(fd)) < 0) {
201  out:  out:

Legend:
Removed from v.814  
changed lines
  Added in v.815