chiark / gitweb /
coredump: simplify a few things by allocating small fields on the stack rather than...
[elogind.git] / src / core / mount.c
index 36375f65bcde4d88790a82d4e9d144e4dd60dfca..e6f0a8a2c1b81f23634f8e36b64183e77267c864 100644 (file)
@@ -823,12 +823,12 @@ void warn_if_dir_nonempty(const char *unit, const char* where) {
         if (r > 0)
                 return;
         else if (r == 0)
-                log_unit_struct(LOG_NOTICE,
-                                unit,
-                                "MESSAGE=%s: Directory %s to mount over is not empty, mounting anyway.",
-                                unit, where,
+                log_unit_struct(unit,
+                                LOG_NOTICE,
+                                LOG_MESSAGE_ID(SD_MESSAGE_OVERMOUNTING),
+                                LOG_MESSAGE("%s: Directory %s to mount over is not empty, mounting anyway.",
+                                            unit, where),
                                 "WHERE=%s", where,
-                                MESSAGE_ID(SD_MESSAGE_OVERMOUNTING),
                                 NULL);
         else
                 log_unit_warning(unit,
@@ -840,12 +840,12 @@ static int fail_if_symlink(const char *unit, const char* where) {
         assert(where);
 
         if (is_symlink(where) > 0) {
-                log_unit_struct(LOG_WARNING,
-                                unit,
-                                "MESSAGE=%s: Mount on symlink %s not allowed.",
-                                unit, where,
+                log_unit_struct(unit,
+                                LOG_ERR,
+                                LOG_MESSAGE_ID(SD_MESSAGE_OVERMOUNTING),
+                                LOG_MESSAGE("%s: Mount on symlink %s not allowed.",
+                                            unit, where),
                                 "WHERE=%s", where,
-                                MESSAGE_ID(SD_MESSAGE_OVERMOUNTING),
                                 NULL);
 
                 return -ELOOP;
@@ -1627,7 +1627,7 @@ static int mount_dispatch_io(sd_event_source *source, int fd, uint32_t revents,
 
         r = mount_load_proc_self_mountinfo(m, true);
         if (r < 0) {
-                log_error("Failed to reread /proc/self/mountinfo: %s", strerror(-r));
+                log_error_errno(r, "Failed to reread /proc/self/mountinfo: %m");
 
                 /* Reset flags, just in case, for later calls */
                 LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_MOUNT]) {