On Tue, Jun 28, 2016 at 09:46:30PM -0700, Philip Guenther wrote: > Inspired by espie@'s ttyname.c diff, here's a simplification of libc's > fallback-to-scanning-/dev code for devname(). Since devname() returns > the "name under /dev", this eliminates the string manipulation == win! > > Works when tested with "stat -Lf %Sr" on a symlink to a device with > /var/run/dev.db chmoded to 600. > > ok? > > Philip Guenther
Looks good. One remark below > > Index: lib/libc/gen/devname.c > =================================================================== > RCS file: /data/src/openbsd/src/lib/libc/gen/devname.c,v > retrieving revision 1.12 > diff -u -p -r1.12 devname.c > --- lib/libc/gen/devname.c 13 Sep 2015 08:31:47 -0000 1.12 > +++ lib/libc/gen/devname.c 28 Jun 2016 07:44:03 -0000 > @@ -28,23 +28,20 @@ > * SUCH DAMAGE. > */ > > -#include <sys/stat.h> > #include <sys/types.h> > +#include <sys/stat.h> Why not keep them sorted ? The fact that stat.h will include types.h is an implementation detail