summaryrefslogtreecommitdiffstats
path: root/bin/pkill
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-09-28 16:44:15 +0000
committered <ed@FreeBSD.org>2008-09-28 16:44:15 +0000
commit67d011afcbb04955068e1ab6d7a373efa90ac749 (patch)
tree2aefed80ae08f7f97a5c019da741a95afc02ce87 /bin/pkill
parent5b4acc89f4b8f019bdeafa0d1471d0b5df6837cb (diff)
downloadFreeBSD-src-67d011afcbb04955068e1ab6d7a373efa90ac749.zip
FreeBSD-src-67d011afcbb04955068e1ab6d7a373efa90ac749.tar.gz
Don't automatically prepend the "tty" prefix to `pkill -t' arguments.
Because we now enforce UNIX98-style PTY's, we now use a lot of TTY's that don't have the traditional /dev/ttyXX naming scheme. pkill(1)'s -t flag automatically prepended the word "tty" to each TTY that was passed on the command line. This meant that `pkill -t pts/0' was actually converted to /dev/ttypts/0. Disable this broken behaviour for now. Reported by: erwin
Diffstat (limited to 'bin/pkill')
-rw-r--r--bin/pkill/pkill.17
-rw-r--r--bin/pkill/pkill.c7
2 files changed, 5 insertions, 9 deletions
diff --git a/bin/pkill/pkill.1 b/bin/pkill/pkill.1
index 725f27e..22b67bf 100644
--- a/bin/pkill/pkill.1
+++ b/bin/pkill/pkill.1
@@ -179,10 +179,9 @@ command.
Restrict matches to processes associated with a terminal in the
comma-separated list
.Ar tty .
-Terminal names may be of the form
-.Pa tty Ns Ar xx
-or the shortened form
-.Ar xx .
+The
+.Pa /dev/
+prefix of the terminal names must be omitted.
A single dash
.Pq Ql -
matches processes not associated with a terminal.
diff --git a/bin/pkill/pkill.c b/bin/pkill/pkill.c
index 2547744..649e7b7 100644
--- a/bin/pkill/pkill.c
+++ b/bin/pkill/pkill.c
@@ -607,12 +607,11 @@ makelist(struct listhead *head, enum listtype type, char *src)
struct passwd *pw;
struct group *gr;
struct stat st;
- const char *cp, *prefix;
+ const char *cp;
char *sp, *ep, buf[MAXPATHLEN];
int empty;
empty = 1;
- prefix = _PATH_DEV;
while ((sp = strsep(&src, ",")) != NULL) {
if (*sp == '\0')
@@ -673,11 +672,9 @@ makelist(struct listhead *head, enum listtype type, char *src)
cp = "console";
} else {
cp = sp;
- if (strncmp(sp, "tty", 3) != 0)
- prefix = _PATH_TTY;
}
- snprintf(buf, sizeof(buf), "%s%s", prefix, cp);
+ snprintf(buf, sizeof(buf), _PATH_DEV "%s", cp);
if (stat(buf, &st) == -1) {
if (errno == ENOENT) {
OpenPOWER on IntegriCloud