Aborted calls return EINTR
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 6 May 2014 23:21:50 +0000 (16:21 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 6 May 2014 23:28:41 +0000 (16:28 -0700)
So no one has to strcmp("syscall aborted").

errstrs are for humans; errnos are for computers!

kern/src/rendez.c

index 6c2665a..3421193 100644 (file)
@@ -40,6 +40,7 @@ void rendez_sleep(struct rendez *rv, int (*cond)(void*), void *arg)
                if (should_abort(&cle)) {
                        cv_unlock_irqsave(&rv->cv, &irq_state);
                        dereg_abortable_cv(&cle);
+                       set_errno(EINTR);
                        error("syscall aborted");
                }
                cv_wait(&rv->cv);
@@ -96,6 +97,7 @@ void rendez_sleep_timeout(struct rendez *rv, int (*cond)(void*), void *arg,
                        cv_unlock_irqsave(&rv->cv, &irq_state);
                        unset_alarm(pcpui_tchain, &awaiter);
                        dereg_abortable_cv(&cle);
+                       set_errno(EINTR);
                        error("syscall aborted");
                }
                cv_wait(&rv->cv);