diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2022-04-30 15:50:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2022-04-30 15:50:45 +0200 |
commit | 267178c62851a2e0fa3825bb49a67e362f41d4c0 (patch) | |
tree | 3171401c7e900519b54a02201735294c7c7e8050 | |
parent | d49da38aa38a3d9a28447fc725b3d43a3fabc7b4 (diff) | |
download | busybox-w32-267178c62851a2e0fa3825bb49a67e362f41d4c0.tar.gz busybox-w32-267178c62851a2e0fa3825bb49a67e362f41d4c0.tar.bz2 busybox-w32-267178c62851a2e0fa3825bb49a67e362f41d4c0.zip |
seedrng: include fiel/dir names in error messages
function old new delta
.rodata 104898 104900 +2
seedrng_main 1011 1003 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-8) Total: -6 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | util-linux/seedrng.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/util-linux/seedrng.c b/util-linux/seedrng.c index 978860bbd..74bf633a7 100644 --- a/util-linux/seedrng.c +++ b/util-linux/seedrng.c | |||
@@ -136,7 +136,7 @@ static void seed_from_file_if_exists(const char *filename, bool credit, sha256_c | |||
136 | seed_len = open_read_close(filename, seed, sizeof(seed)); | 136 | seed_len = open_read_close(filename, seed, sizeof(seed)); |
137 | if (seed_len < 0) { | 137 | if (seed_len < 0) { |
138 | if (errno != ENOENT) | 138 | if (errno != ENOENT) |
139 | bb_perror_msg_and_die("can't%s seed", " read"); | 139 | bb_perror_msg_and_die("can't read '%s'", filename); |
140 | return; | 140 | return; |
141 | } | 141 | } |
142 | xunlink(filename); | 142 | xunlink(filename); |
@@ -178,10 +178,10 @@ int seedrng_main(int argc UNUSED_PARAM, char *argv[]) | |||
178 | bb_simple_error_msg_and_die(bb_msg_you_must_be_root); | 178 | bb_simple_error_msg_and_die(bb_msg_you_must_be_root); |
179 | 179 | ||
180 | if (mkdir(seed_dir, 0700) < 0 && errno != EEXIST) | 180 | if (mkdir(seed_dir, 0700) < 0 && errno != EEXIST) |
181 | bb_perror_msg_and_die("can't %s seed directory", "create"); | 181 | bb_perror_msg_and_die("can't create directory '%s'", seed_dir); |
182 | dfd = xopen(seed_dir, O_DIRECTORY | O_RDONLY); | 182 | dfd = xopen(seed_dir, O_DIRECTORY | O_RDONLY); |
183 | if (flock(dfd, LOCK_EX) < 0) | 183 | if (flock(dfd, LOCK_EX) < 0) |
184 | bb_perror_msg_and_die("can't %s seed directory", "lock"); | 184 | bb_perror_msg_and_die("can't lock seed directory"); |
185 | xfchdir(dfd); | 185 | xfchdir(dfd); |
186 | 186 | ||
187 | sha256_begin(&hash); | 187 | sha256_begin(&hash); |