git » libfiu » commit 58df040

preload/posix: Wrap open() errnos around #ifdefs

author Alberto Bertogli
2009-07-15 17:14:56 UTC
committer Alberto Bertogli
2009-07-15 17:31:28 UTC
parent 6e63df0b565b833cbf2fb682fb82e9cc5625a67f

preload/posix: Wrap open() errnos around #ifdefs

See commit 7db8847, which did the same for the generated code.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

preload/posix/modules/posix.custom.c +41 -1

diff --git a/preload/posix/modules/posix.custom.c b/preload/posix/modules/posix.custom.c
index 5de0599..2e5585f 100644
--- a/preload/posix/modules/posix.custom.c
+++ b/preload/posix/modules/posix.custom.c
@@ -60,7 +60,47 @@ int open(const char *pathname, int flags, ...)
 	/* Use the normal macros to complete the function, now that we have a
 	 * set mode to something */
 
-	int valid_errnos[] = { EACCES, EFAULT, EFBIG, EOVERFLOW, ELOOP, EMFILE, ENAMETOOLONG, ENFILE, ENOENT, ENOMEM, ENOSPC, ENOTDIR, EROFS };
+	int valid_errnos[] = {
+	  #ifdef EACCESS
+		EACCES,
+	  #endif
+	  #ifdef EFAULT
+		EFAULT,
+	  #endif
+	  #ifdef EFBIG
+		EFBIG,
+	  #endif
+	  #ifdef EOVERFLOW
+		EOVERFLOW,
+	  #endif
+	  #ifdef ELOOP
+		ELOOP,
+	  #endif
+	  #ifdef EMFILE
+		EMFILE,
+	  #endif
+	  #ifdef ENAMETOOLONG
+		ENAMETOOLONG,
+	  #endif
+	  #ifdef ENFILE
+		ENFILE,
+	  #endif
+	  #ifdef ENOENT
+		ENOENT,
+	  #endif
+	  #ifdef ENOMEM
+		ENOMEM,
+	  #endif
+	  #ifdef ENOSPC
+		ENOSPC,
+	  #endif
+	  #ifdef ENOTDIR
+		ENOTDIR,
+	  #endif
+	  #ifdef EROFS
+		EROFS
+	  #endif
+	};
 mkwrap_body_errno("posix/io/oc/open", -1)
 mkwrap_bottom(open, (pathname, flags, mode))