On Wed, 29 Jun 2016, Marc Espie wrote: > 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. > > Looks good. > One remark below ... > > -#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
I was going to say that general style seems to be that if you include <sys/types.h> (or <sys/param.h>) to make it the first of the sys/* #includes. But a check of style(9) shows that while that may be a general habit, it ain't codified. /me shrugs and puts them back into their current order
