mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-23 03:10:05 +00:00
Hurd: fix fdatasync/fsync if the fd does not support file_sync
Handle the case of the fd port implementing a stub (EOPNOTSUPP), properly returning EINVAL.
This commit is contained in:
parent
8bece75210
commit
94ce799f82
@ -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].
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user