chiark / gitweb /
udev: remove HWDB_BIN
authorKay Sievers <kay@vrfy.org>
Thu, 7 Feb 2013 20:53:10 +0000 (21:53 +0100)
committerKay Sievers <kay@vrfy.org>
Thu, 7 Feb 2013 20:54:49 +0000 (21:54 +0100)
Makefile.am
src/libudev/libudev-hwdb.c
src/udev/udevadm-hwdb.c

index ad69ee3..9a26a07 100644 (file)
@@ -71,7 +71,6 @@ sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
 varlogdir=$(localstatedir)/log
 systemdstatedir=$(localstatedir)/lib/systemd
 catalogstatedir=$(systemdstatedir)/catalog
-hwdb_bin=/etc/udev/hwdb.bin
 
 # Our own, non-special dirs
 pkgsysconfdir=$(sysconfdir)/systemd
@@ -138,7 +137,6 @@ AM_CPPFLAGS = \
        -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
        -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
        -DCATALOG_PATH=\"$(catalogstatedir)\" \
-       -DHWDB_BIN=\"$(hwdb_bin)\" \
        -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
        -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
        -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
@@ -1786,7 +1784,7 @@ INSTALL_DATA_HOOKS += \
        hwdb-update-hook
 
 hwdb-remove-hook:
-       -test -n "$(DESTDIR)" || rm -f $(HWDB_BIN)
+       -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
 
 # ------------------------------------------------------------------------------
 TESTS += \
index 09096c4..42ab6d9 100644 (file)
@@ -271,30 +271,30 @@ _public_ struct udev_hwdb *udev_hwdb_new(struct udev *udev) {
         hwdb->refcount = 1;
         udev_list_init(udev, &hwdb->properties_list, true);
 
-        hwdb->f = fopen(HWDB_BIN, "re");
+        hwdb->f = fopen("/etc/udev/hwdb.bin", "re");
         if (!hwdb->f) {
-                log_debug("error reading %s: %m", HWDB_BIN);
+                log_debug("error reading /etc/udev/hwdb.bin: %m");
                 udev_hwdb_unref(hwdb);
                 return NULL;
         }
 
         if (fstat(fileno(hwdb->f), &hwdb->st) < 0 ||
             (size_t)hwdb->st.st_size < offsetof(struct trie_header_f, strings_len) + 8) {
-                log_debug("error reading %s: %m", HWDB_BIN);
+                log_debug("error reading /etc/udev/hwdb.bin: %m");
                 udev_hwdb_unref(hwdb);
                 return NULL;
         }
 
         hwdb->map = mmap(0, hwdb->st.st_size, PROT_READ, MAP_SHARED, fileno(hwdb->f), 0);
         if (hwdb->map == MAP_FAILED) {
-                log_debug("error mapping %s: %m", HWDB_BIN);
+                log_debug("error mapping /etc/udev/hwdb.bin: %m");
                 udev_hwdb_unref(hwdb);
                 return NULL;
         }
 
         if (memcmp(hwdb->map, sig, sizeof(hwdb->head->signature)) != 0 ||
             (size_t)hwdb->st.st_size != le64toh(hwdb->head->file_size)) {
-                log_debug("error recognizing the format of %s", HWDB_BIN);
+                log_debug("error recognizing the format of /etc/udev/hwdb.bin");
                 udev_hwdb_unref(hwdb);
                 return NULL;
         }
index 00c0d3d..8e515b9 100644 (file)
@@ -565,11 +565,10 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
                 log_debug("strings dedup'ed: %8zu bytes (%8zu)\n",
                           trie->strings->dedup_len, trie->strings->dedup_count);
 
-                mkdir_parents(HWDB_BIN, 0755);
-                err = trie_store(trie, HWDB_BIN);
+                mkdir_parents("/etc/udev/hwdb.bin", 0755);
+                err = trie_store(trie, "/etc/udev/hwdb.bin");
                 if (err < 0) {
-                        log_error("Failure writing hardware database '%s': %s",
-                                  HWDB_BIN, strerror(-err));
+                        log_error("Failure writing database /etc/udev/hwdb.bin: %s", strerror(-err));
                         rc = EXIT_FAILURE;
                 }
         }