summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-13 12:21:45 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-13 13:26:32 +0200
commit9194c8e4c3a85e098799b3096fe65d1aced02fd4 (patch)
tree2a078c74ca6edcc3018ff61b7637653fd4f46d2f /src
parent7de77d1cf5d5b02cec484175774cf429d5464561 (diff)
system-update-generator: modernizations
Diffstat (limited to 'src')
-rw-r--r--src/system-update-generator/system-update-generator.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/system-update-generator/system-update-generator.c b/src/system-update-generator/system-update-generator.c
index 13b8a0c426..4f22c9c359 100644
--- a/src/system-update-generator/system-update-generator.c
+++ b/src/system-update-generator/system-update-generator.c
@@ -35,10 +35,9 @@
static const char *arg_dest = "/tmp";
static int generate_symlink(void) {
- struct stat st;
- char _cleanup_free_ *p = NULL;
+ const char *p = NULL;
- if (lstat("/system-update", &st) < 0) {
+ if (access("/system-update", F_OK) < 0) {
if (errno == ENOENT)
return 0;
@@ -46,10 +45,7 @@ static int generate_symlink(void) {
return -EINVAL;
}
- p = strappend(arg_dest, "/default.target");
- if (!p)
- return log_oom();
-
+ p = strappenda(arg_dest, "/default.target");
if (symlink(SYSTEM_DATA_UNIT_PATH "/system-update.target", p) < 0) {
log_error("Failed to create symlink %s: %m", p);
return -errno;