From: Mike Yuan Date: Sun, 14 Sep 2025 19:03:15 +0000 (+0200) Subject: remount-fs: minor coding style cleanups X-Git-Tag: v259-rc1~501^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ebb2b33492da5fc91a76dc552d886dcf7cafce6;p=thirdparty%2Fsystemd.git remount-fs: minor coding style cleanups --- diff --git a/src/remount-fs/remount-fs.c b/src/remount-fs/remount-fs.c index 36bc6b7ef20..8dd65637b25 100644 --- a/src/remount-fs/remount-fs.c +++ b/src/remount-fs/remount-fs.c @@ -35,10 +35,8 @@ static int track_pid(Hashmap **h, const char *path, pid_t pid) { return log_oom(); r = hashmap_ensure_put(h, &trivial_hash_ops_value_free, PID_TO_PTR(pid), c); - if (r == -ENOMEM) - return log_oom(); if (r < 0) - return log_error_errno(r, "Failed to store pid " PID_FMT, pid); + return log_error_errno(r, "Failed to store pid " PID_FMT " for mount '%s': %m", pid, path); TAKE_PTR(c); return 0; @@ -48,6 +46,8 @@ static int do_remount(const char *path, bool force_rw, Hashmap **pids) { pid_t pid; int r; + assert(path); + log_debug("Remounting %s...", path); r = safe_fork(force_rw ? "(remount-rw)" : "(remount)", @@ -98,7 +98,7 @@ static int remount_by_fstab(Hashmap **ret_pids) { if (path_equal(me->mnt_dir, "/")) has_root = true; - r = do_remount(me->mnt_dir, false, &pids); + r = do_remount(me->mnt_dir, /* force_rw = */ false, &pids); if (r < 0) return r; } @@ -132,7 +132,7 @@ static int run(int argc, char *argv[]) { log_warning_errno(r, "Failed to parse $SYSTEMD_REMOUNT_ROOT_RW, ignoring: %m"); if (r > 0) { - r = do_remount("/", true, &pids); + r = do_remount("/", /* force_rw = */ true, &pids); if (r < 0) return r; }