fixed up!
[unix-history] / usr / src / bin / csh / proc.c
index f11a7e6..4aeb946 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)proc.c 4.2 %G%";
+static char *sccsid = "@(#)proc.c      4.5 (Berkeley) 81/04/05";
 
 #include "sh.h"
 #include "sh.dir.h"
 
 #include "sh.h"
 #include "sh.dir.h"
@@ -127,9 +127,7 @@ found:
                            jobflags & PAEXITED ||
 #endif
                            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
                            jobflags & PAEXITED ||
 #endif
                            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
-                               if (jobflags & PSTOPPED)
-                                       printf("\n");
-                               pprint(fp, AREASON|SHELLDIR);
+                               ;       /* print in pjwait */
                        } else if ((jobflags & (PTIME|PSTOPPED)) == PTIME)
                                ptprint(fp);
                } else {
                        } else if ((jobflags & (PTIME|PSTOPPED)) == PTIME)
                                ptprint(fp);
                } else {
@@ -226,12 +224,17 @@ pjwait(pp)
        sigrelse(SIGCHLD);
        if (tpgrp > 0)
                ioctl(FSHTTY, TIOCSPGRP, &tpgrp);       /* get tty back */
        sigrelse(SIGCHLD);
        if (tpgrp > 0)
                ioctl(FSHTTY, TIOCSPGRP, &tpgrp);       /* get tty back */
-       if (jobflags & PSTOPPED)
-               return;
-       if ((jobflags&PINTERRUPTED) && setintr &&
+       if ((jobflags&(PSIGNALED|PSTOPPED|PTIME)) ||
+            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
+               if (jobflags&PSTOPPED)
+                       printf("\n");
+               pprint(pp, AREASON|SHELLDIR);
+       }
+       if ((jobflags&(PINTERRUPTED|PSTOPPED)) && setintr &&
            (!gointr || !eq(gointr, "-"))) {
            (!gointr || !eq(gointr, "-"))) {
-               pflush(pp);
-               pintr();
+               if ((jobflags & PSTOPPED) == 0)
+                       pflush(pp);
+               pintr1(0);
                /*NOTREACHED*/
        }
        reason = 0;
                /*NOTREACHED*/
        }
        reason = 0;