ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/branches/MIROS/contrib/mksh/jobs.c
(Generate patch)

Comparing branches/MIROS/contrib/mksh/jobs.c (file contents):
Revision 1224 by laffer1, Sat Aug 18 05:22:23 2007 UTC vs.
Revision 1225 by laffer1, Tue Sep 11 22:02:31 2007 UTC

# Line 1 | Line 1
1 < /*      $OpenBSD: jobs.c,v 1.35 2006/02/06 16:47:07 jmc Exp $   */
1 > /*      $OpenBSD: jobs.c,v 1.36 2007/09/06 19:57:47 otto Exp $  */
2  
3   #include "sh.h"
4  
5 < __RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.25 2007/07/22 13:34:50 tg Exp $");
5 > __RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.28 2007/09/09 19:12:10 tg Exp $");
6  
7   /* Order important! */
8   #define PRUNNING        0
# Line 214 | Line 214 | j_change(void)
214          int i;
215  
216          if (Flag(FMONITOR)) {
217 +                bool use_tty = Flag(FTALKING);
218 +
219                  /* Don't call tcgetattr() 'til we own the tty process group */
220 <                tty_init(false);
220 >                if (use_tty)
221 >                        tty_init(false);
222  
223                  /* no controlling tty, no SIGT* */
224 <                ttypgrp_ok = tty_fd >= 0 && tty_devtty;
224 >                ttypgrp_ok = use_tty && tty_fd >= 0 && tty_devtty;
225  
226                  if (ttypgrp_ok && (our_pgrp = getpgrp()) < 0) {
227                          warningf(false, "j_init: getpgrp() failed: %s",
# Line 264 | Line 267 | j_change(void)
267                                  our_pgrp = kshpid;
268                          }
269                  }
270 <                if (!ttypgrp_ok)
270 >                if (use_tty && !ttypgrp_ok)
271                          warningf(false, "warning: won't have full job control");
272                  if (tty_fd >= 0)
273                          tcgetattr(tty_fd, &tty_state);
# Line 369 | Line 372 | exchild(struct op *t, int flags,
372          else
373                  p->pid = i;
374  
375 +        /* Ensure next child gets a (slightly) different $RANDOM sequence */
376 +        change_random((p->pid << 1) | (ischild ? 1 : 0));
377 +
378          /* job control set up */
379          if (Flag(FMONITOR) && !(flags&XXCOM)) {
380                  int     dotty = 0;
# Line 405 | Line 411 | exchild(struct op *t, int flags,
411                                      SS_RESTORE_DFL|SS_FORCE);
412                  }
413                  if (Flag(FBGNICE) && (flags & XBGND))
414 <                        nice(4);
414 >                        i = nice(4);
415                  if ((flags & XBGND) && !Flag(FMONITOR)) {
416                          setsig(&sigtraps[SIGINT], SIG_IGN,
417                              SS_RESTORE_IGN|SS_FORCE);
# Line 437 | Line 443 | exchild(struct op *t, int flags,
443          }
444  
445          /* shell (parent) stuff */
440        /* Ensure next child gets a (slightly) different $RANDOM sequence */
441        change_random();
446          if (!(flags & XPIPEO)) {        /* last process in a job */
447                  j_startjob(j);
448                  if (flags & XCOPROC) {

Comparing branches/MIROS/contrib/mksh/jobs.c (property cvs2svn:cvs-rev):
Revision 1224 by laffer1, Sat Aug 18 05:22:23 2007 UTC vs.
Revision 1225 by laffer1, Tue Sep 11 22:02:31 2007 UTC

# Line 1 | Line 1
1 < 1.1.1.1
1 > 1.1.1.2

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines