On Sat, Feb 7, 2015 at 3:48 PM, tito <[email protected]> wrote:
>>         char *line=0;
>>         size_t size=0;
>>         if (!f) f = fopen("/etc/passwd", "rbe");
>>         if (!f) return 0;
> Hi,
> this should return ENOENT

You are correct.

>
>>         *pwbufp = __getpwent_a(f, pwbuf, &line, &size);
>>         if (!*pwbufp)
>>                 return 0; /* success (eof) */
>
> this should return ENOENT on EOF and 0 otherwise
> or you will be stuck in infite loops.

This is definitely EOF, not a "success, we got next entry" (since pw == NULL),
so should be "return ENOENT".
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to