if (param->ioctlfd < 0)
return -EIO;
- fd_cloexec(param->ioctlfd, true);
+ (void) fd_cloexec(param->ioctlfd, true);
return param->ioctlfd;
}
/* Before we do anything, let's see if somebody is playing games with us? */
if (lstat(a->where, &st) < 0) {
- log_unit_warning(UNIT(a)->id,
- "%s failed to stat automount point: %m", UNIT(a)->id);
+ log_unit_warning_errno(UNIT(a)->id, errno, "%s failed to stat automount point: %m", UNIT(a)->id);
goto fail;
}
if (safe_atou(value, &token) < 0)
log_unit_debug(u->id, "Failed to parse token value %s", value);
else {
- if (!a->tokens)
- if (!(a->tokens = set_new(NULL)))
- return -ENOMEM;
+ r = set_ensure_allocated(&a->tokens, NULL);
+ if (r < 0) {
+ log_oom();
+ return 0;
+ }
r = set_put(a->tokens, UINT_TO_PTR(token));
if (r < 0)
- return r;
+ log_unit_error_errno(u->id, r, "Failed to add token to set: %m");
}
} else if (streq(key, "expire-token")) {
unsigned token;