Subject: Re: CVS commit: src
To: None <thorpej@netbsd.org>
From: Takehiko NOZAKI <sigsegv@s25.xrea.com>
List: source-changes
Date: 01/17/2005 04:45:24
hi,

At Sun,  2 Jan 2005 18:54:51 +0000 (UTC),
Jason R Thorpe wrote:
> 
> 
> Module Name:	src
> Committed By:	thorpej
> Date:		Sun Jan  2 18:54:51 UTC 2005
> 
> Modified Files:
> 	src/lib/libc/nls: C.msg
> 	src/sys/sys: errno.h
> 
> Log Message:
> Add ENOATTR ("Attribute not found").  From FreeBSD.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -r1.11 -r1.12 src/lib/libc/nls/C.msg
> cvs rdiff -r1.35 -r1.36 src/sys/sys/errno.h
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 
>

don't forget to add message string to `sys_errlist' too,
or strerror(3) won't return correct one.

[how to repeat]

#include <errno.h>
#include <string.h>
main() {
  /* expected: "Attribute not found"
   * actual:   "Unknown error: 93"
   */
  printf("%s\n", strerror(ENOATTR));
}

[fix]

(snip)
Index: __errlist14.c
===================================================================
RCS file: /home/cvs/NetBSD/src/lib/libc/gen/__errlist14.c,v
retrieving revision 1.8
diff -u -r1.8 __errlist14.c
--- __errlist14.c	7 Aug 2003 16:42:45 -0000	1.8
+++ __errlist14.c	16 Jan 2005 19:24:30 -0000
@@ -162,8 +162,9 @@
 /* XSI STREAMS option errors  */
 	"No message available",			/* 89 - ENODATA */
 	"No STREAM resources",			/* 90 - ENOSR */
-	"Not a STREAM"				/* 91 - ENOSTR */
-	"STREAM ioctl timeout"			/* 92 - ETIME */
+	"Not a STREAM",				/* 91 - ENOSTR */
+	"STREAM ioctl timeout",			/* 92 - ETIME */
+	"Attribute not found",			/* 93 - ENOATTR */
 };
 
 const int __sys_nerr14 = sizeof(__errlist14) / sizeof(__errlist14[0]);
(snip)


very truly yours.
--
Takehiko NOZAKI <tnozaki@NetBSD.ORG>