Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2013 18:13:11 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r250706 - head/sys/kern
Message-ID:  <201305161813.r4GIDBwq052709@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Thu May 16 18:13:10 2013
New Revision: 250706
URL: http://svnweb.freebsd.org/changeset/base/250706

Log:
  A library function shall not set errno to 0.
  
  Reviewed by:	mdf

Modified:
  head/sys/kern/subr_sbuf.c

Modified: head/sys/kern/subr_sbuf.c
==============================================================================
--- head/sys/kern/subr_sbuf.c	Thu May 16 17:53:12 2013	(r250705)
+++ head/sys/kern/subr_sbuf.c	Thu May 16 18:13:10 2013	(r250706)
@@ -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
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305161813.r4GIDBwq052709>