From: Lennart Poettering Date: Wed, 28 Nov 2018 11:52:12 +0000 (+0100) Subject: mount: generate error message matching the error location X-Git-Tag: v240~112^2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60b8c203f81fd02ec62ba8a0f6daecbb969df3a8;p=thirdparty%2Fsystemd.git mount: generate error message matching the error location --- diff --git a/src/core/mount.c b/src/core/mount.c index d56b242d095..a9f64eb39a0 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1609,7 +1609,7 @@ static int mount_setup_unit( r = unit_name_from_path(where, ".mount", &e); if (r < 0) - return r; + return log_error_errno(r, "Failed to generate unit name from path '%s': %m", where); u = manager_get_unit(m, e); if (u) @@ -1619,7 +1619,7 @@ static int mount_setup_unit( * by the sysadmin having called mount(8) directly. */ r = mount_setup_new_unit(m, e, what, where, options, fstype, &flags, &u); if (r < 0) - goto fail; + return log_warning_errno(r, "Failed to set up mount unit: %m"); if (set_flags) { MOUNT(u)->is_mounted = flags.is_mounted; @@ -1631,8 +1631,6 @@ static int mount_setup_unit( unit_add_to_dbus_queue(u); return 0; -fail: - return log_warning_errno(r, "Failed to set up mount unit: %m"); } static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) {