diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-11-17 18:35:09 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-11-18 08:24:19 +0100 |
commit | e548078de1229e06d71aef02d99891b251f780f9 (patch) | |
tree | f06ef562cc6416f8ab0857e172f18d66cad90201 | |
parent | bd3c1a2495cbcb51b606f8e4892fcd127f91e645 (diff) |
nptl: sem_open: use open64 if LFS
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | libpthread/nptl/sem_open.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c index 71bebb00a..73d979a43 100644 --- a/libpthread/nptl/sem_open.c +++ b/libpthread/nptl/sem_open.c @@ -39,12 +39,18 @@ /* Compatibility defines. */ #define __endmntent endmntent -#define __fxstat64(vers, fd, buf) fstat64(fd, buf) #define __getmntent_r getmntent_r #define __setmntent setmntent #define __statfs statfs #define __libc_close close -#define __libc_open open +#ifdef __UCLIBC_HAS_LFS__ +# define __libc_open open64 +# define __fxstat64(vers, fd, buf) fstat64(fd, buf) +#else +# define __libc_open open +# define __fxstat64(vers, fd, buf) fstat(fd, buf) +# define stat64 stat +#endif #define __libc_write write @@ -85,10 +91,10 @@ __where_is_shmfs (void) /* OK, do it the hard way. Look through the /proc/mounts file and if this does not exist through /etc/fstab to find the mount point. */ fp = __setmntent ("/proc/mounts", "r"); - if (__builtin_expect (fp == NULL, 0)) + if (unlikely (fp == NULL)) { fp = __setmntent (_PATH_MNTTAB, "r"); - if (__builtin_expect (fp == NULL, 0)) + if (unlikely (fp == NULL)) /* There is nothing we can do. Blind guesses are not helpful. */ return; } @@ -168,13 +174,8 @@ check_add_mapping (const char *name, size_t namelen, int fd, sem_t *existing) sem_t *result = SEM_FAILED; /* Get the information about the file. */ -#ifdef __UCLIBC_HAS_LFS__ struct stat64 st; if (__fxstat64 (_STAT_VER, fd, &st) == 0) -#else - struct stat st; - if (fstat (fd, &st) == 0) -#endif { /* Get the lock. */ lll_lock (__sem_mappings_lock, LLL_PRIVATE); |