[Glibc-bsd-commits] r2569 - trunk/glibc-ports/kfreebsd
Aurelien Jarno
aurel32 at alioth.debian.org
Wed Jun 3 08:03:09 UTC 2009
Author: aurel32
Date: 2009-06-03 08:03:09 +0000 (Wed, 03 Jun 2009)
New Revision: 2569
Modified:
trunk/glibc-ports/kfreebsd/futimesat.c
trunk/glibc-ports/kfreebsd/pread.c
Log:
Fix warnings
Modified: trunk/glibc-ports/kfreebsd/futimesat.c
===================================================================
--- trunk/glibc-ports/kfreebsd/futimesat.c 2009-06-02 18:54:20 UTC (rev 2568)
+++ trunk/glibc-ports/kfreebsd/futimesat.c 2009-06-03 08:03:09 UTC (rev 2569)
@@ -30,7 +30,7 @@
#include <kernel-features.h>
extern int __syscall_futimesat (int fd, const char *path,
- struct timeval *times);
+ const struct timeval *times);
libc_hidden_proto (__syscall_futimesat)
/* Change the access time of FILE relative to FD to TVP[0] and
Modified: trunk/glibc-ports/kfreebsd/pread.c
===================================================================
--- trunk/glibc-ports/kfreebsd/pread.c 2009-06-02 18:54:20 UTC (rev 2568)
+++ trunk/glibc-ports/kfreebsd/pread.c 2009-06-03 08:03:09 UTC (rev 2569)
@@ -34,13 +34,21 @@
__libc_pread (int fd, void *buf, size_t nbytes, __off_t offset)
{
ssize_t result;
- int oldtype;
- if (!SINGLE_THREAD_P)
+ if (SINGLE_THREAD_P)
{
- oldtype = LIBC_CANCEL_ASYNC ();
+
+ /* First try the new syscall. */
+ result = INLINE_SYSCALL (pread, 4, fd, buf, nbytes, offset);
+#ifndef __ASSUME_PREAD_PWRITE_SYSCALLS
+ if (result == -1 && errno == ENOSYS)
+ /* New syscall not available, us the old one. */
+ result = INLINE_SYSCALL (freebsd6_pread, 5, fd, buf, nbytes, 0, offset);
+#endif
+ return result;
}
+ int oldtype = LIBC_CANCEL_ASYNC ();
/* First try the new syscall. */
result = INLINE_SYSCALL (pread, 4, fd, buf, nbytes, offset);
#ifndef __ASSUME_PREAD_PWRITE_SYSCALLS
@@ -48,11 +56,7 @@
/* New syscall not available, us the old one. */
result = INLINE_SYSCALL (freebsd6_pread, 5, fd, buf, nbytes, 0, offset);
#endif
-
- if (!SINGLE_THREAD_P)
- {
- LIBC_CANCEL_RESET (oldtype);
- }
+ LIBC_CANCEL_RESET (oldtype);
return result;
}
More information about the Glibc-bsd-commits
mailing list