diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-03-25 09:46:06 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-03-26 00:10:09 -0600 |
commit | d719f8b600db14c391357a848199c3279507881a (patch) | |
tree | 48b825b06b73c597402badcb72fdc77a5c20b73e | |
parent | Send informational messages on stdout (diff) | |
download | seedrng-d719f8b600db14c391357a848199c3279507881a.tar.xz seedrng-d719f8b600db14c391357a848199c3279507881a.zip |
Compile with -pedantic
I usually code with GNUisms, but given that the purpose of this project
is to make it easy for people to copy and paste this code, I'll stick
with a more standard C.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | seedrng.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -5,7 +5,7 @@ LOCALSTATEDIR ?= /var/lib RUNSTATEDIR ?= /var/run CFLAGS ?= -O2 -pipe -CFLAGS += -std=gnu99 -Wall -Wextra +CFLAGS += -Wall -Wextra -pedantic CFLAGS += -DLOCALSTATEDIR="\"$(LOCALSTATEDIR)\"" -DRUNSTATEDIR="\"$(RUNSTATEDIR)\"" seedrng: seedrng.c @@ -272,7 +272,7 @@ static int read_new_seed(uint8_t *seed, size_t len, bool *is_creditable) if (ret == (ssize_t)len) ret = 0; else - ret = -errno ?: -EIO; + ret = -errno ? -errno : -EIO; close(urandom_fd); return ret; } @@ -298,7 +298,7 @@ static int seed_rng(uint8_t *seed, size_t len, bool credit) return -errno; ret = ioctl(random_fd, RNDADDENTROPY, &req); if (ret) - ret = -errno ?: -EIO; + ret = -errno ? -errno : -EIO; close(random_fd); return ret; } |