This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Alle giovedì 25 ottobre 2012, Roland McGrath ha scritto: > We don't generally handle MIG_BAD_ID. That error indicates a server > not implementing the protocol for which it's being used, which is a > server bug. If anything, we'd translate that to EGRATUITOUS in the > general case, and perhaps to EOPNOTSUPP in particular cases where > it's not an ironclad part of the interface contract that it > implement the particular protocol. So I think we should separate > the MIG_BAD_ID case and treat it more generally, if at all. OK, it seems it could actually be a bug in pflocal, sorry for the bad investigation of thi.s > Since it's the norm for servers to return EOPNOTSUPP for > miscellaneous RPCs they aren't implementing, translating that to > EINVAL for fsync/fdatasync is reasonable. It should have a comment > saying that POSIX.1 specifies EINVAL for a file descriptor on which > sync is not supported. Attached an updated patch to handle only EOPNOTSUPP, with comment added. Thanks, -- Pino Toscano
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. 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. --- 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; } --- 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; }
Attachment:
signature.asc
Description: This is a digitally signed message part.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |