[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: utmp fix for mips64 uClibc systems
From:       Dan Fandrich <dan () coneharvesters ! com>
Date:       2012-09-24 19:30:50
Message-ID: 20120924193050.GB11974 () coneharvesters ! com
[Download RAW message or body]

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
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic