diff options
Diffstat (limited to '')
-rw-r--r-- | src/shared/hwdb-util.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/shared/hwdb-util.c b/src/shared/hwdb-util.c index f67e917..d96902c 100644 --- a/src/shared/hwdb-util.c +++ b/src/shared/hwdb-util.c @@ -6,6 +6,7 @@ #include "alloc-util.h" #include "conf-files.h" +#include "env-util.h" #include "fd-util.h" #include "fileio.h" #include "fs-util.h" @@ -483,7 +484,7 @@ static int import_file(struct trie *trie, const char *filename, uint16_t file_pr if (r == 0) break; - line_number ++; + line_number++; /* comment line */ if (line[0] == '#') @@ -710,3 +711,16 @@ bool hwdb_should_reload(sd_hwdb *hwdb) { return true; return false; } + +int hwdb_bypass(void) { + int r; + + r = getenv_bool("SYSTEMD_HWDB_UPDATE_BYPASS"); + if (r < 0 && r != -ENXIO) + log_debug_errno(r, "Failed to parse $SYSTEMD_HWDB_UPDATE_BYPASS, assuming no."); + if (r <= 0) + return false; + + log_debug("$SYSTEMD_HWDB_UPDATE_BYPASS is enabled, skipping execution."); + return true; +} |