]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Removed duplicate check in random_seed test - bug #140 141/head
authorAlexandru Costache <alexandru.costache.100@gmail.com>
Fri, 4 Jul 2014 08:58:14 +0000 (11:58 +0300)
committeralexandru.costache <alexandru.costache@windriver.com>
Fri, 4 Jul 2014 09:28:35 +0000 (12:28 +0300)
random_seed.c

index 3b520d411e8a8a161f5cc256e1d98a91c8e2b3e8..4f6dbb24f8539629f0a132a97d80b54af95e4df3 100644 (file)
@@ -160,13 +160,10 @@ static int get_dev_random_seed()
     int r;
     ssize_t nread = read(fd, &r, sizeof(r));
     if (nread != sizeof(r)) {
-        fprintf(stderr, "error read %s: %s", dev_random_file, strerror(errno));
-        exit(1);
-    }
-    else if (nread != sizeof(r)) {
-        fprintf(stderr, "error short read %s", dev_random_file);
+        fprintf(stderr, "error short read %s: %s", dev_random_file, strerror(errno));
         exit(1);
     }
+
     close(fd);
     return r;
 }