svn commit: r303565 - head/lib/libc/gen

Andrey A. Chernov ache at FreeBSD.org
Sun Jul 31 02:28:52 UTC 2016


Author: ache
Date: Sun Jul 31 02:28:50 2016
New Revision: 303565
URL: https://svnweb.freebsd.org/changeset/base/303565

Log:
  In addition to prev. commit. Since potentially glob2() can return error
  without setting errno, restore errno before its call.

Modified:
  head/lib/libc/gen/glob.c

Modified: head/lib/libc/gen/glob.c
==============================================================================
--- head/lib/libc/gen/glob.c	Sun Jul 31 01:14:06 2016	(r303564)
+++ head/lib/libc/gen/glob.c	Sun Jul 31 02:28:50 2016	(r303565)
@@ -821,6 +821,8 @@ glob3(Char *pathbuf, Char *pathend, Char
 			errno = 0;
 			continue;
 		}
+		if (errno == 0)
+			errno = saverrno;
 		err = glob2(pathbuf, --dc, pathend_last, restpattern,
 		    pglob, limit);
 		if (err)


More information about the svn-src-all mailing list