SCCS-vsn: usr.bin/w/w.c 5.2
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)w.c 5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)w.c 5.2 (Berkeley) %G%";
continue;
jobtime += pr[i].w_time + pr[i].w_ctime;
proctime += pr[i].w_time;
continue;
jobtime += pr[i].w_time + pr[i].w_ctime;
proctime += pr[i].w_time;
+ /*
+ * Meaning of debug fields following proc name is:
+ * & by itself: ignoring both SIGINT and QUIT.
+ * (==> this proc is not a candidate.)
+ * & <i> <q>: i is SIGINT status, q is quit.
+ * 0 == DFL, 1 == IGN, 2 == caught.
+ * *: proc pgrp == tty pgrp.
+ */
+ if (debug) {
printf("\t\t%d\t%s", pr[i].w_pid, pr[i].w_args);
if ((j=pr[i].w_igintr) > 0)
if (j==IGINT)
printf("\t\t%d\t%s", pr[i].w_pid, pr[i].w_args);
if ((j=pr[i].w_igintr) > 0)
if (j==IGINT)
lseek(kmem, (int)(aproc + pn), 0);
read(kmem, &mproc, sizeof mproc);
/* decide if it's an interesting process */
lseek(kmem, (int)(aproc + pn), 0);
read(kmem, &mproc, sizeof mproc);
/* decide if it's an interesting process */
- if (mproc.p_stat==0 || mproc.p_pgrp==0)
+ if (mproc.p_stat==0 || mproc.p_stat==SZOMB || mproc.p_pgrp==0)
continue;
/* find & read in the user structure */
if ((mproc.p_flag & SLOAD) == 0) {
continue;
/* find & read in the user structure */
if ((mproc.p_flag & SLOAD) == 0) {