make it look like kernel driver
[unix-history] / usr / src / bin / csh / proc.c
index 83a668d..e0c9aa5 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char *sccsid = "@(#)proc.c      5.3 (Berkeley) %G%";
+static char *sccsid = "@(#)proc.c      5.5 (Berkeley) %G%";
 #endif
 
 #include "sh.h"
 #endif
 
 #include "sh.h"
@@ -585,8 +585,9 @@ pprint(pp, flag)
                                case PINTERRUPTED:
                                case PSTOPPED:
                                case PSIGNALED:
                                case PINTERRUPTED:
                                case PSTOPPED:
                                case PSIGNALED:
-                                       if (flag&REASON || reason != SIGINT ||
-                                           reason != SIGPIPE)
+                                       if ((flag&(REASON|AREASON))
+                                           && reason != SIGINT
+                                           && reason != SIGPIPE)
                                                printf(format, mesg[pp->p_reason].pname);
                                        break;
 
                                                printf(format, mesg[pp->p_reason].pname);
                                        break;
 
@@ -789,7 +790,7 @@ dokill(v)
                }
                if (digit(v[0][1])) {
                        signum = atoi(v[0]+1);
                }
                if (digit(v[0][1])) {
                        signum = atoi(v[0]+1);
-                       if (signum < 1 || signum > NSIG)
+                       if (signum < 0 || signum > NSIG)
                                bferr("Bad signal number");
                } else {
                        name = &v[0][1];
                                bferr("Bad signal number");
                } else {
                        name = &v[0][1];
@@ -847,7 +848,7 @@ pkill(v, signum)
                        }
                        if (signum == SIGTERM || signum == SIGHUP)
                                (void) killpg(pp->p_jobid, SIGCONT);
                        }
                        if (signum == SIGTERM || signum == SIGHUP)
                                (void) killpg(pp->p_jobid, SIGCONT);
-               } else if (!digit(*cp))
+               } else if (!(digit(*cp) || *cp == '-'))
                        bferr("Arguments should be jobs or process id's");
                else {
                        pid = atoi(cp);
                        bferr("Arguments should be jobs or process id's");
                else {
                        pid = atoi(cp);