summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.topdeps4
-rw-r--r--.topmsg30
-rw-r--r--hurd/dtable.c2
-rw-r--r--hurd/hurdauth.c1
-rw-r--r--hurd/hurdexec.c1
-rw-r--r--hurd/hurdfchdir.c1
-rw-r--r--hurd/hurdioctl.c1
-rw-r--r--hurd/hurdsig.c1
-rw-r--r--hurd/hurdsock.c5
-rw-r--r--hurd/intern-fd.c1
-rw-r--r--hurd/setauth.c1
-rw-r--r--hurd/seteuids.c1
-rw-r--r--hurd/thread-cancel.c1
-rw-r--r--sysdeps/mach/hurd/faccessat.c1
-rw-r--r--sysdeps/mach/hurd/fork.c1
-rw-r--r--sysdeps/mach/hurd/setegid.c1
-rw-r--r--sysdeps/mach/hurd/seteuid.c1
-rw-r--r--sysdeps/mach/hurd/setgid.c1
-rw-r--r--sysdeps/mach/hurd/setgroups.c1
-rw-r--r--sysdeps/mach/hurd/setregid.c1
-rw-r--r--sysdeps/mach/hurd/setresgid.c1
-rw-r--r--sysdeps/mach/hurd/setresuid.c1
-rw-r--r--sysdeps/mach/hurd/setreuid.c1
-rw-r--r--sysdeps/mach/hurd/setsid.c1
-rw-r--r--sysdeps/mach/hurd/setuid.c1
-rw-r--r--sysdeps/mach/hurd/spawni.c1
26 files changed, 35 insertions, 28 deletions
diff --git a/.topdeps b/.topdeps
index 05fc6f6b77..1098ad67c1 100644
--- a/.topdeps
+++ b/.topdeps
@@ -1 +1,3 @@
-t/io_select_timeout
+t/faccessat
+t/sendmsg-SCM_CREDS
+t/poll_errors_fixes
diff --git a/.topmsg b/.topmsg
index 64569de288..0a4399a491 100644
--- a/.topmsg
+++ b/.topmsg
@@ -1,30 +1,6 @@
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Subject: Fix poll and select POSIX compliancy details about errors
-
-This fixes the following:
+Subject: [PATCH] eintr
-- On error, poll must not return without polling, including EBADF, and instead
-report POLLHUP/POLLERR/POLLNVAL
-- Select must report EBADF if some set contains an invalid FD.
-
-The idea is to move error management to after all select calls, in the
-poll/select final treatment. The error is instead recorded in a new `error'
-field, and a new SELECT_ERROR bit set.
-
-Thanks Svante Signell for the initial version of the patch.
-
-* hurd/hurdselect.c (SELECT_ERROR): New macro.
-(_hurd_select):
-- Add `error' field to `d' structures array.
-- If a poll descriptor is bogus, set EBADF, but continue with a zero timeout.
-- Go through the whole fd_set, not only until _hurd_dtablesize. Return EBADF
-there is any bit set above _hurd_dtablesize.
-- Do not request io_select on bogus descriptors (SELECT_ERROR).
-- On io_select request error, record the error.
-- On io_select bogus reply, use EIO error code.
-- On io_select bogus or error reply, record the error.
-- Do not destroy reply port for bogus FDs.
-- On error, make poll set POLLHUP in the EPIPE case, POLLNVAL in the EBADF
-case, or else POLLERR.
-- On error, make select simulated readiness.
+Fix spurious eintr occurrences
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
diff --git a/hurd/dtable.c b/hurd/dtable.c
index 5c204676f8..c36d60fc86 100644
--- a/hurd/dtable.c
+++ b/hurd/dtable.c
@@ -235,6 +235,7 @@ ctty_new_pgrp (void)
__mutex_unlock (&_hurd_dtable_lock);
HURD_CRITICAL_END;
+ /* TODO: handle EINTR! */
(void) &ctty_new_pgrp; /* Avoid "defined but not used" warning. */
}
@@ -297,6 +298,7 @@ reauth_dtable (void)
__mutex_unlock (&_hurd_dtable_lock);
HURD_CRITICAL_END;
+ /* TODO: handle EINTR! */
(void) &reauth_dtable; /* Avoid "defined but not used" warning. */
}
diff --git a/hurd/hurdauth.c b/hurd/hurdauth.c
index 1a7e67ea0e..c61af64a53 100644
--- a/hurd/hurdauth.c
+++ b/hurd/hurdauth.c
@@ -223,6 +223,7 @@ _S_msg_del_auth (mach_port_t me,
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* TODO: handle EINTR */
if (err)
return err;
diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c
index 732c9ec34b..003c22fc13 100644
--- a/hurd/hurdexec.c
+++ b/hurd/hurdexec.c
@@ -428,6 +428,7 @@ _hurd_exec_paths (task_t task, file_t file,
/* Safe to let signals happen now. */
_hurd_critical_section_unlock (ss);
+ /* FIXME: handle EINTR */
outargs:
free (args);
diff --git a/hurd/hurdfchdir.c b/hurd/hurdfchdir.c
index cde753cc68..3759e3c734 100644
--- a/hurd/hurdfchdir.c
+++ b/hurd/hurdfchdir.c
@@ -53,6 +53,7 @@ _hurd_change_directory_port_from_fd (struct hurd_port *portcell, int fd)
}));
HURD_CRITICAL_END;
+ /* TODO:handle EINTR */
return ret;
}
diff --git a/hurd/hurdioctl.c b/hurd/hurdioctl.c
index 5b05b3bfff..c40fa9ea2b 100644
--- a/hurd/hurdioctl.c
+++ b/hurd/hurdioctl.c
@@ -211,6 +211,7 @@ install_ctty (mach_port_t cttyid)
__mutex_lock (&_hurd_dtable_lock);
_hurd_locked_install_cttyid (cttyid);
HURD_CRITICAL_END;
+ /* TODO: handle EINTR! */
}
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index aa82f63413..035c45d7e6 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -1366,6 +1366,7 @@ reauth_proc (mach_port_t new)
if (! HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC],
__proc_reauthenticate (port, ref,
MACH_MSG_TYPE_MAKE_SEND) ||
+ /* FIXME: handle EINTR */
__auth_user_authenticate (new, ref,
MACH_MSG_TYPE_MAKE_SEND,
&ignore))
diff --git a/hurd/hurdsock.c b/hurd/hurdsock.c
index bb98a6b745..e9334ba78d 100644
--- a/hurd/hurdsock.c
+++ b/hurd/hurdsock.c
@@ -52,6 +52,7 @@ _hurd_socket_server (int domain, int dead)
return MACH_PORT_NULL;
}
+retry:
HURD_CRITICAL_BEGIN;
__mutex_lock (&lock);
@@ -102,6 +103,10 @@ _hurd_socket_server (int domain, int dead)
__mutex_unlock (&lock);
HURD_CRITICAL_END;
+ if (!server && errno == EINTR)
+ /* Got a signal while inside an RPC of the critical section, retry again */
+ goto retry;
+
return server;
}
diff --git a/hurd/intern-fd.c b/hurd/intern-fd.c
index 3b00824cc1..085ae2bd10 100644
--- a/hurd/intern-fd.c
+++ b/hurd/intern-fd.c
@@ -37,6 +37,7 @@ _hurd_intern_fd (io_t port, int flags, int dealloc)
__spin_unlock (&d->port.lock);
}
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (d == NULL)
{
diff --git a/hurd/setauth.c b/hurd/setauth.c
index 025be580e1..a8af439c97 100644
--- a/hurd/setauth.c
+++ b/hurd/setauth.c
@@ -107,6 +107,7 @@ _hurd_setauth (auth_t new)
__mutex_unlock (&reauth_lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
return 0;
}
diff --git a/hurd/seteuids.c b/hurd/seteuids.c
index edfa4c2195..0dbe44d78b 100644
--- a/hurd/seteuids.c
+++ b/hurd/seteuids.c
@@ -47,6 +47,7 @@ seteuids (int n, const uid_t *uids)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/hurd/thread-cancel.c b/hurd/thread-cancel.c
index c70b814dda..fe9786f755 100644
--- a/hurd/thread-cancel.c
+++ b/hurd/thread-cancel.c
@@ -80,6 +80,7 @@ hurd_thread_cancel (thread_t thread)
}
_hurd_critical_section_unlock (ss);
+ /* FIXME: handle EINTR */
return err;
}
diff --git a/sysdeps/mach/hurd/faccessat.c b/sysdeps/mach/hurd/faccessat.c
index d9bceaada7..c81c310af0 100644
--- a/sysdeps/mach/hurd/faccessat.c
+++ b/sysdeps/mach/hurd/faccessat.c
@@ -170,6 +170,7 @@ __faccessat_common (int fd, const char *file, int type, int at_flags,
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (rcrdir != MACH_PORT_NULL)
__mach_port_deallocate (__mach_task_self (), rcrdir);
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index 2d1e64c8d1..36a33684fd 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -692,6 +692,7 @@ __fork (void)
}
_hurd_critical_section_unlock (ss);
+ /* FIXME: handle EINTR */
if (!err)
{
diff --git a/sysdeps/mach/hurd/setegid.c b/sysdeps/mach/hurd/setegid.c
index c5e8cf622f..7b43b33b9d 100644
--- a/sysdeps/mach/hurd/setegid.c
+++ b/sysdeps/mach/hurd/setegid.c
@@ -55,6 +55,7 @@ setegid (gid_t gid)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/seteuid.c b/sysdeps/mach/hurd/seteuid.c
index d6001960a8..5715f9960b 100644
--- a/sysdeps/mach/hurd/seteuid.c
+++ b/sysdeps/mach/hurd/seteuid.c
@@ -55,6 +55,7 @@ seteuid (uid_t uid)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/setgid.c b/sysdeps/mach/hurd/setgid.c
index faac055f71..82b193bfae 100644
--- a/sysdeps/mach/hurd/setgid.c
+++ b/sysdeps/mach/hurd/setgid.c
@@ -81,6 +81,7 @@ __setgid (gid_t gid)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/setgroups.c b/sysdeps/mach/hurd/setgroups.c
index cdfa869fc2..ae0d631885 100644
--- a/sysdeps/mach/hurd/setgroups.c
+++ b/sysdeps/mach/hurd/setgroups.c
@@ -50,6 +50,7 @@ setgroups (size_t n, const gid_t *groups)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/setregid.c b/sysdeps/mach/hurd/setregid.c
index 45953474b7..8ebd7ff62b 100644
--- a/sysdeps/mach/hurd/setregid.c
+++ b/sysdeps/mach/hurd/setregid.c
@@ -82,6 +82,7 @@ __setregid (gid_t rgid, gid_t egid)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/setresgid.c b/sysdeps/mach/hurd/setresgid.c
index d09935d8b0..5c97688907 100644
--- a/sysdeps/mach/hurd/setresgid.c
+++ b/sysdeps/mach/hurd/setresgid.c
@@ -110,6 +110,7 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/setresuid.c b/sysdeps/mach/hurd/setresuid.c
index 3ed7dfd021..c560858c11 100644
--- a/sysdeps/mach/hurd/setresuid.c
+++ b/sysdeps/mach/hurd/setresuid.c
@@ -111,6 +111,7 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/setreuid.c b/sysdeps/mach/hurd/setreuid.c
index 12548b375b..f716ddc825 100644
--- a/sysdeps/mach/hurd/setreuid.c
+++ b/sysdeps/mach/hurd/setreuid.c
@@ -82,6 +82,7 @@ __setreuid (uid_t ruid, uid_t euid)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/setsid.c b/sysdeps/mach/hurd/setsid.c
index 7b989361d1..35d74c9938 100644
--- a/sysdeps/mach/hurd/setsid.c
+++ b/sysdeps/mach/hurd/setsid.c
@@ -60,6 +60,7 @@ __setsid (void)
}
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
return err ? __hurd_fail (err) : _hurd_pgrp;
}
diff --git a/sysdeps/mach/hurd/setuid.c b/sysdeps/mach/hurd/setuid.c
index e3c0120c98..425aa60b68 100644
--- a/sysdeps/mach/hurd/setuid.c
+++ b/sysdeps/mach/hurd/setuid.c
@@ -86,6 +86,7 @@ __setuid (uid_t uid)
}
__mutex_unlock (&_hurd_id.lock);
HURD_CRITICAL_END;
+ /* FIXME: handle EINTR! */
if (err)
return __hurd_fail (err);
diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c
index 9351c13e56..abc57997c4 100644
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -370,6 +370,7 @@ __spawni (pid_t *pid, const char *file,
/* Safe to let signals happen now. */
_hurd_critical_section_unlock (ss);
+ /* FIXME: handle EINTR */
/* Execute the file actions. */
if (file_actions != NULL)