about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/shm_open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-08-19 06:15:56 +0000
committerUlrich Drepper <drepper@redhat.com>2003-08-19 06:15:56 +0000
commitee4e5a3db1dd65546eaf66eba73c325553015281 (patch)
treed38bdd084d86ca3f7099a66e961a0360e0d20121 /sysdeps/unix/sysv/linux/shm_open.c
parentfd82139fa58ef52bc23bff26db26d53356230557 (diff)
downloadglibc-ee4e5a3db1dd65546eaf66eba73c325553015281.tar.gz
glibc-ee4e5a3db1dd65546eaf66eba73c325553015281.tar.xz
glibc-ee4e5a3db1dd65546eaf66eba73c325553015281.zip
Update.
2003-08-18  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/shm_open.c (shm_open): Fold EISDIR error
	into EINVAL.
Diffstat (limited to 'sysdeps/unix/sysv/linux/shm_open.c')
-rw-r--r--sysdeps/unix/sysv/linux/shm_open.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/shm_open.c b/sysdeps/unix/sysv/linux/shm_open.c
index b118533dca..73804f5349 100644
--- a/sysdeps/unix/sysv/linux/shm_open.c
+++ b/sysdeps/unix/sysv/linux/shm_open.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -181,6 +181,11 @@ shm_open (const char *name, int oflag, mode_t mode)
 	  __set_errno (save_errno);
 	}
     }
+  else if (__builtin_expect (errno == EISDIR, 0))
+    /* It might be better to fold this error with EINVAL since
+       directory names are just another example for unsuitable shared
+       object names and the standard does not mention EISDIR.  */
+    __set_errno (EINVAL);
 
   return fd;
 }