summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-06-02 17:58:58 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2009-06-02 17:58:58 +0200
commit0e605ccee71b9072671b7dfe93a4b82400277e60 (patch)
tree24d9562535ee6b2944fbfd5a023d029baee124d6
parentb32dd708df63d90f9d755b6c0de2588200e432ca (diff)
include errno.h unconditionally
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r--librt/shm.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/librt/shm.c b/librt/shm.c
index 637e94559..3f33d68af 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;
}