Patchwork libgo patch committed: Correct ENOSYS functions

login
register
mail settings
Submitter Ian Taylor
Date Feb. 2, 2012, 10:58 p.m.
Message ID <mcr39asallb.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/139247/
State New
Headers show

Comments

Ian Taylor - Feb. 2, 2012, 10:58 p.m.
I foolishly messed up writing the ENOSYS functions for systems which
don't have them.  I had them return ENOSYS, rather than setting errno
and returning an error indicator.  This patch corrects this oversight.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian

Patch

diff -r a79fa0b4c24e libgo/runtime/go-nosys.c
--- a/libgo/runtime/go-nosys.c	Thu Feb 02 14:21:14 2012 -0800
+++ b/libgo/runtime/go-nosys.c	Thu Feb 02 14:57:54 2012 -0800
@@ -31,7 +31,8 @@ 
 int
 epoll_create1 (int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -42,7 +43,8 @@ 
 	   int mode __attribute__ ((unused)),
 	   int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -53,7 +55,8 @@ 
 	  mode_t mode __attribute__ ((unused)),
 	  int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -65,7 +68,8 @@ 
 	  gid_t group __attribute__ ((unused)),
 	  int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -75,7 +79,8 @@ 
 	   const char *pathname __attribute__ ((unused)),
 	   const struct timeval times[2] __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -85,7 +90,8 @@ 
 		   const char* pathname __attribute__ ((unused)),
 		   uint32_t mask __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -93,7 +99,8 @@ 
 int
 inotify_init (void)
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -102,7 +109,8 @@ 
 inotify_rm_watch (int fd __attribute__ ((unused)),
 		  uint32_t wd __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -112,7 +120,8 @@ 
 	 const char *pathname __attribute__ ((unused)),
 	 mode_t mode __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -123,7 +132,8 @@ 
 	 mode_t mode __attribute__ ((unused)),
 	 dev_t dev __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -134,7 +144,8 @@ 
 	int oflag __attribute__ ((unused)),
 	...)
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -145,7 +156,8 @@ 
 	  int newdirfd __attribute__ ((unused)),
 	  const char *newpath __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -158,7 +170,8 @@ 
 	size_t len __attribute__ ((unused)),
 	unsigned int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -169,7 +182,8 @@ 
      size_t len __attribute__ ((unused)),
      unsigned int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -179,7 +193,8 @@ 
 	  const char *pathname __attribute__ ((unused)),
 	  int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif
 
@@ -187,6 +202,7 @@ 
 int
 unshare (int flags __attribute__ ((unused)))
 {
-  return ENOSYS;
+  errno = ENOSYS;
+  return -1;
 }
 #endif