Skip to contentSkip to conversation

nanosleep doesn't write remaining time

PATCH New Thayne Harbaugh 1 participant 1 message Dec 13, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nanosleep doesn't write remaining time

nanosleep() doesn't write remaining time if there's an error - but it's when return value == -1 and errno == EINTR when the remaining time must be written.

linux-user/syscall.c +1 -1
Index: qemu/linux-user/syscall.c
===================================================================
@@ -5134,7 +5134,7 @@
             if (copy_from_user_timespec(&req, arg1))
                 goto efault;
             ret = get_errno(nanosleep(&req, &rem));
-            if (!is_error(ret) && arg2) {
+            if (ret == -TARGET_EINTR && arg2) {
                 if (copy_to_user_timespec(arg2, &rem))
                     goto efault;
             }