utmp fix for mips64 uClibc systems

Dan Fandrich dan at coneharvesters.com
Mon Sep 24 19:30:50 UTC 2012


On Mon, Sep 24, 2012 at 09:12:01PM +0200, Waldemar Brodkorb wrote:
> +        if (access(filename, R_OK | W_OK) == -1) {
> +                c=open(filename, O_WRONLY | O_CREAT, 0664);
> +                if (c > 0) {

0 is a perfectly valid file descriptor. This should be c >= 0, or
just use xopen().

> +                        close(c);
> +                }
> +        }

>>> Dan


More information about the busybox mailing list