]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
rnd-getentropy: better handling of error printing with errno
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 21 Jul 2016 09:53:46 +0000 (11:53 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 21 Jul 2016 10:07:25 +0000 (12:07 +0200)
lib/nettle/rnd-getentropy.c

index a0553d9597a7096bf4867d3100abec05f5da6458..f83053444b689d6249d62f3f9b13ea742a19f14f 100644 (file)
 static int _rnd_get_system_entropy_simple(void* _rnd, size_t size)
 {
        if (getentropy(_rnd, size) < 0) {
+               int e = errno;
                gnutls_assert();
                _gnutls_debug_log
                        ("Failed to use getentropy: %s\n",
-                                        strerror(errno));
+                                        strerror(e));
                return GNUTLS_E_RANDOM_DEVICE_ERROR;
        }
        return 0;