1470 strtol doesn't set errno = EINVAL if conversion failed
authorYakov Zaytsev <zaytsev.yakov@gmail.com>
Wed, 05 Oct 2011 05:23:02 -0700
changeset 13478 b5ecd19f36a6
parent 13477 3d8bcfed4059
child 13479 68b69d972a7f
1470 strtol doesn't set errno = EINVAL if conversion failed Reviewed by: Gordon Ross <[email protected]> Reviewed by: Jason King <[email protected]> Reviewed by: Gary Mills <[email protected]> Reviewed by: Garrett D'Amore <[email protected]> Approved by: Eric Schrock <[email protected]>
usr/src/common/util/strtol.c
--- a/usr/src/common/util/strtol.c	Sun Oct 02 23:44:03 2011 +0400
+++ b/usr/src/common/util/strtol.c	Wed Oct 05 05:23:02 2011 -0700
@@ -20,6 +20,10 @@
  */
 
 /*
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ */
+
+/*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -96,6 +100,7 @@
 #if	defined(_KERNEL) && !defined(_BOOT)
 		return (EINVAL);
 #else	/* _KERNEL && !_BOOT */
+		errno = EINVAL;
 		return (0);
 #endif	/* _KERNEL && !_BOOT */
 	}