diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2010-01-04 10:37:07 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2010-01-04 10:37:07 +0000 |
commit | 39a60cbcab7b06d78287bf7d5fa7fa440cec1a73 (patch) | |
tree | 3f5dd173efc9c1d36b8848350b2aacb3d0381cd4 /bin | |
parent | 72cef5b74f06d18edc9675f607ab848ebb6bce47 (diff) | |
download | src-39a60cbcab7b06d78287bf7d5fa7fa440cec1a73.tar.gz src-39a60cbcab7b06d78287bf7d5fa7fa440cec1a73.zip |
Fix the "-t" functionality. Per the regression tests (pgrep-t.t & pkill-t.t),
"-t" should accept "v1", which means a plain number should be accepted for
UNIX98-style PTY's.
Notes
Notes:
svn path=/head/; revision=201484
Diffstat (limited to 'bin')
-rw-r--r-- | bin/pkill/pkill.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/pkill/pkill.c b/bin/pkill/pkill.c index 69349c3c5890..258b3c8031bf 100644 --- a/bin/pkill/pkill.c +++ b/bin/pkill/pkill.c @@ -670,9 +670,6 @@ makelist(struct listhead *head, enum listtype type, char *src) if (li->li_number == 0) li->li_number = -1; /* any jail */ break; - case LT_TTY: - usage(); - /* NOTREACHED */ default: break; } @@ -708,6 +705,10 @@ makelist(struct listhead *head, enum listtype type, char *src) if (stat(buf, &st) != -1) goto foundtty; + snprintf(buf, sizeof(buf), _PATH_DEV "pts/%s", cp); + if (stat(buf, &st) != -1) + goto foundtty; + if (errno == ENOENT) errx(STATUS_BADUSAGE, "No such tty: `%s'", sp); err(STATUS_ERROR, "Cannot access `%s'", sp); |