summaryrefslogtreecommitdiff
path: root/src/shared/machine-image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-02-03 02:05:59 +0100
committerLennart Poettering <lennart@poettering.net>2015-02-03 02:05:59 +0100
commit63c372cb9df3bee01e3bf8cd7f96f336bddda846 (patch)
treebf4d1b6e41f72927a2b58e7dd21daa0c496aaa96 /src/shared/machine-image.c
parent44de0efc6e406515fc1cf8b95d9655d0d7f7ffff (diff)
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
Diffstat (limited to 'src/shared/machine-image.c')
-rw-r--r--src/shared/machine-image.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
index 8ea61052bd..8d61507e84 100644
--- a/src/shared/machine-image.c
+++ b/src/shared/machine-image.c
@@ -425,7 +425,7 @@ int image_rename(Image *i, const char *new_name) {
case IMAGE_RAW: {
const char *fn;
- fn = strappenda(new_name, ".raw");
+ fn = strjoina(new_name, ".raw");
new_path = file_in_same_dir(i->path, fn);
break;
}
@@ -486,13 +486,13 @@ int image_clone(Image *i, const char *new_name, bool read_only) {
case IMAGE_SUBVOLUME:
case IMAGE_DIRECTORY:
- new_path = strappenda("/var/lib/machines/", new_name);
+ new_path = strjoina("/var/lib/machines/", new_name);
r = btrfs_subvol_snapshot(i->path, new_path, read_only, true);
break;
case IMAGE_RAW:
- new_path = strappenda("/var/lib/machines/", new_name, ".raw");
+ new_path = strjoina("/var/lib/machines/", new_name, ".raw");
r = copy_file_atomic(i->path, new_path, read_only ? 0444 : 0644, false, FS_NOCOW_FL);
break;
@@ -629,7 +629,7 @@ int image_name_lock(const char *name, int operation, LockFile *ret) {
return -EBUSY;
mkdir_p("/run/systemd/nspawn/locks", 0600);
- p = strappenda("/run/systemd/nspawn/locks/name-", name);
+ p = strjoina("/run/systemd/nspawn/locks/name-", name);
return make_lock_file(p, operation, ret);
}