diff --git a/NEWS b/NEWS index c884b15f..c160a4a7 100644 --- a/NEWS +++ b/NEWS @@ -5,8 +5,9 @@ procps-ng-NEXT * ps: Fallback to attr/current for context Debian #786956 * tests: Conditionally add prctl Debian #816237 * pidof: check cmd if space in argv0. GitLab #4 - * kill: report error if cannot kill process #733172 + * kill: report error if cannot kill process Debian #733172 * watch: Add hostname to header + * library: Find tty quicker Debian #770215 procps-ng-3.3.11 ---------------- diff --git a/proc/devname.c b/proc/devname.c index e6d0b554..10b7845d 100644 --- a/proc/devname.c +++ b/proc/devname.c @@ -132,9 +132,12 @@ static int driver_name(char *restrict const buf, unsigned maj, unsigned min){ } sprintf(buf, "/dev/%s%d", tmn->name, min); /* like "/dev/ttyZZ255" */ if(stat(buf, &sbuf) < 0){ - if(tmn->devfs_type) return 0; - sprintf(buf, "/dev/%s", tmn->name); /* like "/dev/ttyZZ255" */ - if(stat(buf, &sbuf) < 0) return 0; + sprintf(buf, "/dev/%s/%d", tmn->name, min); /* like "/dev/pts/255" */ + if(stat(buf, &sbuf) < 0){ + if(tmn->devfs_type) return 0; + sprintf(buf, "/dev/%s", tmn->name); /* like "/dev/ttyZZ255" */ + if(stat(buf, &sbuf) < 0) return 0; + } } if(min != MINOR_OF(sbuf.st_rdev)) return 0; if(maj != MAJOR_OF(sbuf.st_rdev)) return 0;