about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--sysdeps/mach/hurd/fdatasync.c8
-rw-r--r--sysdeps/mach/hurd/fsync.c8
3 files changed, 18 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0cfa229b5e..d2c7cc7509 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-10-29  Pino Toscano  <toscano.pino@tiscali.it>
 
+	* sysdeps/mach/hurd/fdatasync.c: Turn ERR into EINVAL if it is
+	EOPNOTSUPP.
+	* sysdeps/mach/hurd/fsync.c: Likewise.
+
 	* sysdeps/pthread/aio_notify.c (__aio_notify_only)
 	[_POSIX_REALTIME_SIGNALS]: Change condition to
 	[_POSIX_REALTIME_SIGNALS > 0].
diff --git a/sysdeps/mach/hurd/fdatasync.c b/sysdeps/mach/hurd/fdatasync.c
index 19d7a4a58a..22c1d103d4 100644
--- a/sysdeps/mach/hurd/fdatasync.c
+++ b/sysdeps/mach/hurd/fdatasync.c
@@ -26,6 +26,12 @@ fdatasync (int fd)
 {
   error_t err = HURD_DPORT_USE (fd, __file_sync (port, 1, 1));
   if (err)
-    return __hurd_dfail (fd, err);
+    {
+      if (err == EOPNOTSUPP)
+	/* If the file descriptor does not support sync, return EINVAL
+	   as POSIX specifies.  */
+	err = EINVAL;
+      return __hurd_dfail (fd, err);
+    }
   return 0;
 }
diff --git a/sysdeps/mach/hurd/fsync.c b/sysdeps/mach/hurd/fsync.c
index a474c8a356..fe3e044a3a 100644
--- a/sysdeps/mach/hurd/fsync.c
+++ b/sysdeps/mach/hurd/fsync.c
@@ -27,6 +27,12 @@ fsync (fd)
 {
   error_t err = HURD_DPORT_USE (fd, __file_sync (port, 1, 0));
   if (err)
-    return __hurd_dfail (fd, err);
+    {
+      if (err == EOPNOTSUPP)
+	/* If the file descriptor does not support sync, return EINVAL
+	   as POSIX specifies.  */
+	err = EINVAL;
+      return __hurd_dfail (fd, err);
+    }
   return 0;
 }