X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Futil.c;h=61d6680dddfb5c5dabbe9a45b38b7ebe658f9ee6;hb=d5099efc47d4e6ac60816b5381a5f607ab03f06e;hp=cf9d487b829b67087691a43da7959d0637020a10;hpb=8a7c93d858c342744adf481565d8bb03b9713dcf;p=elogind.git diff --git a/src/shared/util.c b/src/shared/util.c index cf9d487b8..61d6680dd 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -3911,7 +3911,7 @@ void execute_directory(const char *directory, DIR *d, usec_t timeout, char *argv } } - pids = hashmap_new(NULL, NULL); + pids = hashmap_new(NULL); if (!pids) { log_oom(); _exit(EXIT_FAILURE); @@ -4981,24 +4981,6 @@ bool kexec_loaded(void) { return loaded; } -int strdup_or_null(const char *a, char **b) { - char *c; - - assert(b); - - if (!a) { - *b = NULL; - return 0; - } - - c = strdup(a); - if (!c) - return -ENOMEM; - - *b = c; - return 0; -} - int prot_from_flags(int flags) { switch (flags & O_ACCMODE) { @@ -6712,7 +6694,7 @@ int bind_remount_recursive(const char *prefix, bool ro) { path_kill_slashes(cleaned); - done = set_new(string_hash_func, string_compare_func); + done = set_new(&string_hash_ops); if (!done) return -ENOMEM; @@ -6722,7 +6704,7 @@ int bind_remount_recursive(const char *prefix, bool ro) { bool top_autofs = false; char *x; - todo = set_new(string_hash_func, string_compare_func); + todo = set_new(&string_hash_ops); if (!todo) return -ENOMEM;