[git commit] include errno.h unconditionally

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Tue Jun 2 15:58:58 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=c5d3c1a6d2d77ff57872147731463c3ff728062a
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl


Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
Signed-off-by: Austin Foxley <austinf at cetoncorp.com>
---
 librt/shm.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/librt/shm.c b/librt/shm.c
index 637e945..3f33d68 100644
--- a/librt/shm.c
+++ b/librt/shm.c
@@ -10,10 +10,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
-
-#ifndef O_CLOEXEC
 #include <errno.h>
-#endif
 
 #ifndef _PATH_SHM
 #define _PATH_SHM "/dev/shm/"
@@ -87,12 +84,14 @@ int shm_open(const char *name, int oflag, mode_t mode)
 int shm_unlink(const char *name)
 {
 	char *shm_name = get_shm_name(name);
-	int ret;
+	int ret, old_errno;
 
 	/* Stripped multiple '/' from start; may have set errno properly */
 	if (shm_name == NULL)
 		return -1;
 	ret = unlink(shm_name);
+	old_errno = errno;
 	free(shm_name);
+	errno = old_errno;
 	return ret;
 }
-- 
1.6.0.6


More information about the uClibc-cvs mailing list