summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorShawn Landden <shawnlandden@gmail.com>2012-07-25 14:55:59 -0700
committerKay Sievers <kay@vrfy.org>2012-07-26 11:48:26 +0200
commit0d0f0c50d3a1d90f03972a6abb82e6413daaa583 (patch)
tree74f41c8455dbd78599f49300315a2569a8989992 /src/core/manager.c
parente146e4516b9ea9907852e7ad609de39dca9e8769 (diff)
log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 42a9490242..bcaf913b5a 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1625,7 +1625,7 @@ void manager_send_unit_plymouth(Manager *m, Unit *u) {
}
if (asprintf(&message, "U\002%c%s%n", (int) (strlen(u->id) + 1), u->id, &n) < 0) {
- log_error("Out of memory.");
+ log_oom();
goto finish;
}
@@ -2073,10 +2073,8 @@ static int create_generator_dir(Manager *m, char **generator, const char *name)
if (m->running_as == MANAGER_SYSTEM && getpid() == 1) {
p = strappend("/run/systemd/", name);
- if (!p) {
- log_error("Out of memory.");
- return -ENOMEM;
- }
+ if (!p)
+ return log_oom();
r = mkdir_p_label(p, 0755);
if (r < 0) {
@@ -2086,10 +2084,8 @@ static int create_generator_dir(Manager *m, char **generator, const char *name)
}
} else {
p = strjoin("/tmp/systemd-", name, ".XXXXXX", NULL);
- if (!p) {
- log_error("Out of memory.");
- return -ENOMEM;
- }
+ if (!p)
+ return log_oom();
if (!mkdtemp(p)) {
free(p);