[BusyBox] getty and login utmp handling

Rob Landley rob at landley.net
Wed Aug 25 18:54:03 UTC 2004


On Tuesday 24 August 2004 05:43, Manousaridis Angelos wrote:
> -               creat(_PATH_UTMP, 0664);
> +               int fd = creat(_PATH_UTMP, 0664);
> +               close(fd);

Declaring fd just makes the code longer here, you might as well just go 
close(create(...))

I realise that this almost certainly optimized away anyway, but I think it 
makes it shorter and simpler to read, since you're not using fd to do any 
error checking or anything (which would be superfluous if close(-1) doesn't 
barf on you)...

This being a nit-pick, I'll happily wait until after 1.0 to actually suggest a 
patch. :)

Rob
-- 
www.linucon.org: Linux Expo and Science Fiction Convention
October 8-10, 2004 in Austin Texas.  (I'm the con chair.)




More information about the busybox mailing list