summaryrefslogtreecommitdiff
path: root/src/getty-generator/getty-generator.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/getty-generator/getty-generator.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/getty-generator/getty-generator.c')
-rw-r--r--src/getty-generator/getty-generator.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c
index 9e46a47a9..1cef6aeae 100644
--- a/src/getty-generator/getty-generator.c
+++ b/src/getty-generator/getty-generator.c
@@ -42,8 +42,7 @@ static int add_symlink(const char *fservice, const char *tservice) {
to = strjoin(arg_dest,"/getty.target.wants/", tservice, NULL);
if (!from || !to) {
- log_error("Out of memory.");
- r = -ENOMEM;
+ r = log_oom();
goto finish;
}
@@ -77,10 +76,8 @@ static int add_serial_getty(const char *tty) {
log_debug("Automatically adding serial getty for /dev/%s.", tty);
n = unit_name_replace_instance("serial-getty@.service", tty);
- if (!n) {
- log_error("Out of memory.");
- return -ENOMEM;
- }
+ if (!n)
+ return log_oom();
r = add_symlink("serial-getty@.service", n);
free(n);
@@ -160,7 +157,7 @@ int main(int argc, char *argv[]) {
int k;
if (asprintf(&p, "/sys/class/tty/%s", j) < 0) {
- log_error("Out of memory.");
+ log_oom();
r = EXIT_FAILURE;
goto finish;
}