chiark / gitweb /
sd-event: fix typo
[elogind.git] / src / remount-fs / remount-fs.c
index 847637a12ca3988e9f3970e2407e4a82bc54570a..70dacfafc16509a0d41b4b29b36d0cfe85938de5 100644 (file)
@@ -20,7 +20,6 @@
 ***/
 
 #include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
 #include <string.h>
 #include <sys/stat.h>
@@ -30,7 +29,6 @@
 #include "log.h"
 #include "util.h"
 #include "path-util.h"
-#include "set.h"
 #include "mount-setup.h"
 #include "exit-status.h"
 
@@ -60,11 +58,11 @@ int main(int argc, char *argv[]) {
                 if (errno == ENOENT)
                         return EXIT_SUCCESS;
 
-                log_error("Failed to open /etc/fstab: %m");
+                log_error_errno(errno, "Failed to open /etc/fstab: %m");
                 return EXIT_FAILURE;
         }
 
-        pids = hashmap_new(trivial_hash_func, trivial_compare_func);
+        pids = hashmap_new(NULL);
         if (!pids) {
                 log_error("Failed to allocate set");
                 goto finish;
@@ -87,7 +85,7 @@ int main(int argc, char *argv[]) {
 
                 pid = fork();
                 if (pid < 0) {
-                        log_error("Failed to fork: %m");
+                        log_error_errno(errno, "Failed to fork: %m");
                         ret = EXIT_FAILURE;
                         continue;
                 }
@@ -104,7 +102,7 @@ int main(int argc, char *argv[]) {
 
                         execv("/bin/mount", (char **) arguments);
 
-                        log_error("Failed to execute /bin/mount: %m");
+                        log_error_errno(errno, "Failed to execute /bin/mount: %m");
                         _exit(EXIT_FAILURE);
                 }
 
@@ -120,7 +118,7 @@ int main(int argc, char *argv[]) {
 
                 k = hashmap_put(pids, UINT_TO_PTR(pid), s);
                 if (k < 0) {
-                        log_error("Failed to add PID to set: %s", strerror(-k));
+                        log_error_errno(k, "Failed to add PID to set: %m");
                         ret = EXIT_FAILURE;
                         continue;
                 }
@@ -135,7 +133,7 @@ int main(int argc, char *argv[]) {
                         if (errno == EINTR)
                                 continue;
 
-                        log_error("waitid() failed: %m");
+                        log_error_errno(errno, "waitid() failed: %m");
                         ret = EXIT_FAILURE;
                         break;
                 }