various: do not include file names directly in error messages

git grep -l 'Failed to open /'|xargs sed -r -i 's|"Failed to open (/[^ ]+): %m"|"Failed to open %s: %m", "\1"|g'
git grep -l $'Failed to open \'/'|xargs sed -r -i $'s|"Failed to open \'(/[^ ]+)\': %m"|"Failed to open %s: %m", "\\1"|g'
git grep -l "Failed to open /"|xargs sed -r -i $'s|"Failed to open (/[^ ]+), ignoring: %m"|"Failed to open %s, ignoring: %m", "\\1"|g'
+ some manual fixups.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-06-02 11:10:38 +02:00
parent 3f1812180b
commit 42ba99748d
37 changed files with 55 additions and 55 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ static int delete_dm(DeviceMapper *m) {
fd = open("/dev/mapper/control", O_RDWR|O_CLOEXEC);
if (fd < 0)
return log_debug_errno(errno, "Failed to open /dev/mapper/control: %m");
return log_debug_errno(errno, "Failed to open %s: %m", "/dev/mapper/control");
return RET_NERRNO(ioctl(fd, DM_DEV_REMOVE, &(struct dm_ioctl) {
.version = {
+1 -1
View File
@@ -197,7 +197,7 @@ static int sync_making_progress(unsigned long long *prev_dirty) {
f = fopen("/proc/meminfo", "re");
if (!f)
return log_warning_errno(errno, "Failed to open /proc/meminfo: %m");
return log_warning_errno(errno, "Failed to open %s: %m", "/proc/meminfo");
for (;;) {
_cleanup_free_ char *line = NULL;
+1 -1
View File
@@ -188,7 +188,7 @@ static void log_umount_blockers(const char *mnt) {
_cleanup_closedir_ DIR *dir = opendir("/proc");
if (!dir)
return (void) log_warning_errno(errno, "Failed to open /proc/: %m");
return (void) log_warning_errno(errno, "Failed to open %s: %m", "/proc/");
FOREACH_DIRENT_ALL(de, dir, break) {
if (!IN_SET(de->d_type, DT_DIR, DT_UNKNOWN))