[hurd,commited] hurd: Make _hurd_intr_rpc_mach_msg avoid returning MACH_SEND_INTERRUPTED

Message ID 20231114010623.645083-1-samuel.thibault@ens-lyon.org
State Committed
Commit 8f22e36238c94e2a89da624e03c224895f9dd691
Headers
Series [hurd,commited] hurd: Make _hurd_intr_rpc_mach_msg avoid returning MACH_SEND_INTERRUPTED |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch warning Patch already apply to master at the time it was sent
redhat-pt-bot/TryBot-32bit fail Patch series failed to apply

Commit Message

Samuel Thibault Nov. 14, 2023, 1:06 a.m. UTC
  When the given options do not include MACH_SEND_INTERRUPT,
_hurd_intr_rpc_mach_msg (aka mach_msg) is not supposed to return
MACH_SEND_INTERRUPTED.  In such a case we thus have to retry sending the
message.

This was observed to fix various occurrences of spurious
"(ipc/send) interrupted" errors when running haskell programs.
---
 hurd/intr-msg.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c
index bc1f43d383..98f588f206 100644
--- a/hurd/intr-msg.c
+++ b/hurd/intr-msg.c
@@ -143,6 +143,12 @@  _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
 	     XXX */
 	  goto retry_receive;
 	}
+      if (!(option & MACH_SEND_INTERRUPT))
+	{
+	  option = user_option;
+	  timeout = user_timeout;
+	  goto message;
+	}
       /* FALLTHROUGH */
 
       /* These are the other codes that mean a pseudo-receive modified