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]>
--- 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 */
}