(original) (raw)

changeset: 102702:ad141164c792 user: Victor Stinner victor.stinner@gmail.com date: Tue Aug 16 18:27:44 2016 +0200 files: Python/random.c description: Issue #27776: dev_urandom(raise=0) now closes the file descriptor on error diff -r 86d0d74bc2e1 -r ad141164c792 Python/random.c --- a/Python/random.c Tue Aug 16 18:46:38 2016 +0200 +++ b/Python/random.c Tue Aug 16 18:27:44 2016 +0200 @@ -331,6 +331,7 @@ if (n <= 0) { /* stop on error or if read(size) returned 0 */ + close(fd); return -1; } /victor.stinner@gmail.com