summaryrefslogtreecommitdiffstats
path: root/bin/pkill/pkill.c
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/pkill.c
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/pkill.c')
-rw-r--r--bin/pkill/pkill.c7
1 files changed, 2 insertions, 5 deletions
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