diff options
author | Tomi Leppänen <tomi.leppanen@jolla.com> | 2021-03-03 09:47:03 +0200 |
---|---|---|
committer | Tomi Leppänen <tomi.leppanen@jolla.com> | 2021-03-03 09:55:11 +0200 |
commit | dc48b88db9f1c467f13ccc501e317179d26804d2 (patch) | |
tree | b76a6dbe5a5eefea5ab4c3e094bb0075fdbb0179 /src | |
parent | Improve error reporting while mounting (diff) | |
download | firejail-dc48b88db9f1c467f13ccc501e317179d26804d2.tar.gz firejail-dc48b88db9f1c467f13ccc501e317179d26804d2.tar.zst firejail-dc48b88db9f1c467f13ccc501e317179d26804d2.zip |
Use strerror(errno) instead of %m
Better for portability and consistency. Currently strerror() is used
everywhere else, so use it here as well. printf's %m is a glibc
extension that is supported also by some other libc implementations.
Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/sandbox.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c index a04551ed4..a97ca0abb 100644 --- a/src/firejail/sandbox.c +++ b/src/firejail/sandbox.c | |||
@@ -975,10 +975,10 @@ int sandbox(void* sandbox_arg) { | |||
975 | fs_private_dir_copy("/usr/etc", RUN_USR_ETC_DIR, cfg.etc_private_keep); // openSUSE | 975 | fs_private_dir_copy("/usr/etc", RUN_USR_ETC_DIR, cfg.etc_private_keep); // openSUSE |
976 | 976 | ||
977 | if (umount2("/etc/group", MNT_DETACH) == -1) | 977 | if (umount2("/etc/group", MNT_DETACH) == -1) |
978 | fprintf(stderr, "/etc/group: unmount: %m\n"); | 978 | fprintf(stderr, "/etc/group: unmount: %s\n", strerror(errno)); |
979 | 979 | ||
980 | if (umount2("/etc/passwd", MNT_DETACH) == -1) | 980 | if (umount2("/etc/passwd", MNT_DETACH) == -1) |
981 | fprintf(stderr, "/etc/passwd: unmount: %m\n"); | 981 | fprintf(stderr, "/etc/passwd: unmount: %s\n", strerror(errno)); |
982 | 982 | ||
983 | fs_private_dir_mount("/etc", RUN_ETC_DIR); | 983 | fs_private_dir_mount("/etc", RUN_ETC_DIR); |
984 | fs_private_dir_mount("/usr/etc", RUN_USR_ETC_DIR); | 984 | fs_private_dir_mount("/usr/etc", RUN_USR_ETC_DIR); |