A library function shall not set errno to 0.

Reviewed by:	mdf
This commit is contained in:
Jaakko Heinonen 2013-05-16 18:13:10 +00:00
parent 6d07d3e014
commit c532f8c4d6

View File

@ -706,9 +706,10 @@ sbuf_finish(struct sbuf *s)
#ifdef _KERNEL
return (s->s_error);
#else
errno = s->s_error;
if (s->s_error)
if (s->s_error != 0) {
errno = s->s_error;
return (-1);
}
return (0);
#endif
}