diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-04-30 23:09:40 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-04-30 23:09:40 +0400 |
commit | cce741c409bbd77b7a648dcf9bed8f7fba169352 (patch) | |
tree | d9b7466ecfffed5e9aa452de176501c9aff4bb93 /winsup | |
parent | 7aefc1596dd41465005dc9d7569a0ff6caa4a118 (diff) |
* sysv_msg.cc: Add fix from upstream version 1.65.
(msgsnd): Call msleep with timeout value. Handle EWOULDBLOCK. Make
sure it's clear from where msleep has been called in debug output.
(msgrcv): Make sure it's clear from where msleep has been called in
debug output.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygserver/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygserver/sysv_msg.cc | 10 |
2 files changed, 15 insertions, 3 deletions
diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog index c8693eeac..f05f253b4 100644 --- a/winsup/cygserver/ChangeLog +++ b/winsup/cygserver/ChangeLog @@ -1,3 +1,11 @@ +2008-04-30 Corinna Vinschen <corinna@vinschen.de> + + * sysv_msg.cc: Add fix from upstream version 1.65. + (msgsnd): Call msleep with timeout value. Handle EWOULDBLOCK. Make + sure it's clear from where msleep has been called in debug output. + (msgrcv): Make sure it's clear from where msleep has been called in + debug output. + 2008-02-06 Corinna Vinschen <corinna@vinschen.de> * bsd_helper.cc: Replace %E __small_printf format specifier with %lu diff --git a/winsup/cygserver/sysv_msg.cc b/winsup/cygserver/sysv_msg.cc index 5ad3b659b..217cc1d97 100644 --- a/winsup/cygserver/sysv_msg.cc +++ b/winsup/cygserver/sysv_msg.cc @@ -722,10 +722,14 @@ msgsnd(struct thread *td, struct msgsnd_args *uap) } DPRINTF(("goodnight\n")); error = msleep(msqptr, &msq_mtx, (PZERO - 4) | PCATCH, - "msgwait", 0); + "msgsnd", 50); DPRINTF(("good morning, error=%d\n", error)); if (we_own_it) msqptr->msg_perm.mode &= ~MSG_LOCKED; + if (error == EWOULDBLOCK) { + DPRINTF(("timed out\n")); + continue; + } if (error != 0) { DPRINTF(("msgsnd: interrupted system call\n")); #ifdef __CYGWIN__ @@ -1079,11 +1083,11 @@ msgrcv(struct thread *td, struct msgrcv_args *uap) DPRINTF(("msgrcv: goodnight\n")); error = msleep(msqptr, &msq_mtx, (PZERO - 4) | PCATCH, - "msgwait", 0); + "msgrcv", 0); DPRINTF(("msgrcv: good morning (error=%d)\n", error)); if (error != 0) { - DPRINTF(("msgsnd: interrupted system call\n")); + DPRINTF(("msgrcv: interrupted system call\n")); #ifdef __CYGWIN__ if (error != EIDRM) #endif /* __CYGWIN__ */ |