diff options
author | jh <jh@FreeBSD.org> | 2013-05-16 18:13:10 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2013-05-16 18:13:10 +0000 |
commit | a3ca3565e218ee62d141cc6194cd8bfacf21aaaf (patch) | |
tree | 0806a6826db3eae0b8df4022d00d9cd169cd97f3 /sys/kern | |
parent | 80dd90c797cd27bef36665858bc80e09def94a1e (diff) | |
download | FreeBSD-src-a3ca3565e218ee62d141cc6194cd8bfacf21aaaf.zip FreeBSD-src-a3ca3565e218ee62d141cc6194cd8bfacf21aaaf.tar.gz |
A library function shall not set errno to 0.
Reviewed by: mdf
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_sbuf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c index cd3295f..68a7b15 100644 --- a/sys/kern/subr_sbuf.c +++ b/sys/kern/subr_sbuf.c @@ -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 } |