malloc: Do not clobber errno on __getrandom_nocancel (BZ #29624)
[platform/upstream/glibc.git] / stdlib / arc4random.c
index 960a38f..c126c60 100644 (file)
@@ -51,7 +51,7 @@ __arc4random_buf (void *p, size_t n)
          n -= l;
          continue; /* Interrupted by a signal; keep going.  */
        }
-      else if (l < 0 && errno == ENOSYS)
+      else if (l == -ENOSYS)
        break; /* No syscall, so fallback to /dev/urandom.  */
       arc4random_getrandom_failure ();
     }