chiark / gitweb /
udevd: event - make db loading lazy in REMOVE event handling
[elogind.git] / src / libudev / libudev-device-private.c
index aa3b2270e0c9c4c393cb409759005b0260ff6c47..e5902887482c458d2aaf778055362e9e5d24680b 100644 (file)
@@ -17,7 +17,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <stddef.h>
@@ -128,10 +127,8 @@ int udev_device_update_db(struct udev_device *udev_device)
         strscpyl(filename_tmp, sizeof(filename_tmp), filename, ".tmp", NULL);
         mkdir_parents(filename_tmp, 0755);
         f = fopen(filename_tmp, "we");
-        if (f == NULL) {
-                log_debug("unable to create temporary db file '%s': %m", filename_tmp);
-                return -errno;
-        }
+        if (f == NULL)
+                return log_debug_errno(errno, "unable to create temporary db file '%s': %m", filename_tmp);
 
         /*
          * set 'sticky' bit to indicate that we should not clean the
@@ -185,6 +182,7 @@ int udev_device_delete_db(struct udev_device *udev_device)
         if (id == NULL)
                 return -1;
         strscpyl(filename, sizeof(filename), "/run/udev/data/", id, NULL);
+
         unlink(filename);
         return 0;
 }