#include "strv.h"
#include "unit-name.h"
#include "mkdir.h"
+#include "string-util.h"
+#include "parse-util.h"
static const char *arg_dest = "/tmp";
static char **arg_mask = NULL;
else {
char *n;
- n = unit_name_mangle(value, MANGLE_NOGLOB);
- if (!n)
- return log_oom();
+ r = unit_name_mangle(value, UNIT_NAME_NOGLOB, &n);
+ if (r < 0)
+ return log_error_errno(r, "Failed to glob unit name: %m");
r = strv_consume(&arg_mask, n);
if (r < 0)
else {
char *n;
- n = unit_name_mangle(value, MANGLE_NOGLOB);
- if (!n)
- return log_oom();
+ r = unit_name_mangle(value, UNIT_NAME_NOGLOB, &n);
+ if (r < 0)
+ return log_error_errno(r, "Failed to glob unit name: %m");
r = strv_consume(&arg_wants, n);
if (r < 0)
if (!p)
return log_oom();
- if (symlink("/dev/null", p) < 0) {
- log_error("Failed to create mask symlink %s: %m", p);
- r = -errno;
- }
+ if (symlink("/dev/null", p) < 0)
+ r = log_error_errno(errno,
+ "Failed to create mask symlink %s: %m",
+ p);
}
return r;
mkdir_parents_label(p, 0755);
- if (symlink(f, p) < 0) {
- log_error("Failed to create wants symlink %s: %m", p);
- r = -errno;
- }
+ if (symlink(f, p) < 0)
+ r = log_error_errno(errno,
+ "Failed to create wants symlink %s: %m",
+ p);
}
return r;
r = parse_proc_cmdline(parse_proc_cmdline_item);
if (r < 0)
- log_warning_errno(-r, "Failed to parse kernel command line, ignoring: %m");
+ log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
if (arg_debug_shell) {
r = strv_extend(&arg_wants, "debug-shell.service");