--- pkill.c.orig Sat Nov 9 16:58:07 2002 +++ pkill.c Thu Jan 8 21:55:20 2004 @@ -115,10 +115,7 @@ struct listhead pgrplist = SLIST_HEAD_INITIALIZER(list); struct listhead ppidlist = SLIST_HEAD_INITIALIZER(list); struct listhead tdevlist = SLIST_HEAD_INITIALIZER(list); -/* - * XXX - filtering by session ID currently does not work struct listhead sidlist = SLIST_HEAD_INITIALIZER(list); - */ int main(int, char **); void usage(void); @@ -179,11 +176,7 @@ criteria = 0; drop_privs = 0; -/* - * XXX - filtering by session ID currently does not work while ((ch = getopt(argc, argv, "G:M:N:P:U:d:fg:lns:t:u:vx")) != -1) - */ - while ((ch = getopt(argc, argv, "G:M:N:P:U:d:fg:lnt:u:vx")) != -1) switch (ch) { case 'G': makelist(&rgidlist, LT_GROUP, optarg); @@ -226,13 +219,10 @@ newest = 1; criteria = 1; break; -/* - * XXX - filtering by session ID currently does not work case 's': makelist(&sidlist, LT_SID, optarg); criteria = 1; break; - */ case 't': makelist(&tdevlist, LT_TTY, optarg); criteria = 1; @@ -391,17 +381,14 @@ continue; } -/* - * XXX - filtering by session ID currently does not work SLIST_FOREACH(li, &sidlist, li_chain) if (kp->kp_eproc.e_sess != ((struct session *)0)) - if (kp->kp_eproc.e_sess->s_sid == (pid_t)li->li_number) + if (kp->kp_eproc.e_sid == (pid_t)li->li_number) break; if (SLIST_FIRST(&sidlist) != NULL && li == NULL) { selected[i] = 0; continue; } - */ if (argc == 0) selected[i] = 1; @@ -463,11 +450,7 @@ ustr = "[-signal] [-fnvx]"; (void)fprintf(stderr, "usage: %s %s [-G gid] [-M core] [-N system]\n" - " [-P ppid] [-U uid] [-g pgrp] [-t tty]\n" -/* - * XXX - filtering by session ID currently does not work " [-P ppid] [-U uid] [-g pgrp] [-s sid] [-t tty]\n" - */ " [-u euid] pattern ...\n", getprogname(), ustr); exit(STATUS_ERROR);