X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fautomount.c;h=f72aca29579aea9bf61f5a9a3d25df329c88e536;hb=f1f00dbb7f3741b30d4a26b1a8b65ec46ff1fde3;hp=77d80b2789e49bc6bbd8dcc1c5d9d7dbd73f5d3b;hpb=03e334a1c7dc8c20c38902aa039440763acc9b17;p=elogind.git diff --git a/src/core/automount.c b/src/core/automount.c index 77d80b278..f72aca295 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -144,7 +144,7 @@ static int automount_add_default_dependencies(Automount *a) { static int automount_verify(Automount *a) { bool b; - char *e; + _cleanup_free_ char *e = NULL; assert(a); if (UNIT(a)->load_state != UNIT_LOADED) @@ -160,7 +160,6 @@ static int automount_verify(Automount *a) { return -ENOMEM; b = unit_has_name(UNIT(a), e); - free(e); if (!b) { log_error_unit(UNIT(a)->id, "%s's Where setting doesn't match unit name. Refusing.", UNIT(a)->id); @@ -532,7 +531,7 @@ static void automount_enter_waiting(Automount *a) { return; fail: - close_pipe(p); + safe_close_pair(p); if (mounted) repeat_unmount(a->where); @@ -686,7 +685,7 @@ static int automount_deserialize_item(Unit *u, const char *key, const char *valu log_debug_unit(u->id, "Failed to parse token value %s", value); else { if (!a->tokens) - if (!(a->tokens = set_new(trivial_hash_func, trivial_compare_func))) + if (!(a->tokens = set_new(NULL))) return -ENOMEM; r = set_put(a->tokens, UINT_TO_PTR(token)); @@ -763,7 +762,7 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo } else log_debug_unit(UNIT(a)->id, "Got direct mount request on %s", a->where); - r = set_ensure_allocated(&a->tokens, trivial_hash_func, trivial_compare_func); + r = set_ensure_allocated(&a->tokens, NULL); if (r < 0) { log_error_unit(UNIT(a)->id, "Failed to allocate token set."); goto fail;