summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2022-04-30 15:50:45 +0200
committerDenys Vlasenko2022-04-30 15:50:45 +0200
commit267178c62851a2e0fa3825bb49a67e362f41d4c0 (patch)
tree3171401c7e900519b54a02201735294c7c7e8050
parentd49da38aa38a3d9a28447fc725b3d43a3fabc7b4 (diff)
downloadbusybox-267178c62851a2e0fa3825bb49a67e362f41d4c0.zip
busybox-267178c62851a2e0fa3825bb49a67e362f41d4c0.tar.gz
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util-linux/seedrng.c b/util-linux/seedrng.c
index 978860b..74bf633 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
seed_len = open_read_close(filename, seed, sizeof(seed));
if (seed_len < 0) {
if (errno != ENOENT)
- bb_perror_msg_and_die("can't%s seed", " read");
+ bb_perror_msg_and_die("can't read '%s'", filename);
return;
}
xunlink(filename);
@@ -178,10 +178,10 @@ int seedrng_main(int argc UNUSED_PARAM, char *argv[])
bb_simple_error_msg_and_die(bb_msg_you_must_be_root);
if (mkdir(seed_dir, 0700) < 0 && errno != EEXIST)
- bb_perror_msg_and_die("can't %s seed directory", "create");
+ bb_perror_msg_and_die("can't create directory '%s'", seed_dir);
dfd = xopen(seed_dir, O_DIRECTORY | O_RDONLY);
if (flock(dfd, LOCK_EX) < 0)
- bb_perror_msg_and_die("can't %s seed directory", "lock");
+ bb_perror_msg_and_die("can't lock seed directory");
xfchdir(dfd);
sha256_begin(&hash);