summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-25 14:22:43 +0100
committerTom Gundersen <teg@jklm.no>2015-10-25 14:22:43 +0100
commit7c8871d31510865e40c8628ef765996202a3cc00 (patch)
tree622b7aa085999fe3d2908772ff0d0c6ec5bf4400 /src/machine
parent7c257428969aaba2acc4e26753c86d6f4774354a (diff)
parentf00022dd121c73b543ae667ddce9814bd67a1b73 (diff)
Merge pull request #1654 from poettering/util-lib
Various changes to src/basic/
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machine-dbus.c19
-rw-r--r--src/machine/machine.c6
-rw-r--r--src/machine/machinectl.c14
-rw-r--r--src/machine/machined-dbus.c18
-rw-r--r--src/machine/machined.c10
-rw-r--r--src/machine/machined.h7
6 files changed, 41 insertions, 33 deletions
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index 6e41e92962..c17a98e90f 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -29,22 +29,23 @@
#include <libgen.h>
#undef basename
-#include "bus-util.h"
-#include "bus-label.h"
-#include "strv.h"
#include "bus-common-errors.h"
+#include "bus-internal.h"
+#include "bus-label.h"
+#include "bus-util.h"
#include "copy.h"
+#include "env-util.h"
+#include "fd-util.h"
#include "fileio.h"
+#include "formats-util.h"
#include "in-addr-util.h"
#include "local-addresses.h"
-#include "path-util.h"
-#include "mkdir.h"
-#include "bus-internal.h"
-#include "machine.h"
#include "machine-dbus.h"
-#include "formats-util.h"
+#include "machine.h"
+#include "mkdir.h"
+#include "path-util.h"
#include "process-util.h"
-#include "env-util.h"
+#include "strv.h"
#include "terminal-util.h"
static int property_get_id(
diff --git a/src/machine/machine.c b/src/machine/machine.c
index 7ab84607fb..e41f8add98 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -27,16 +27,18 @@
#include "bus-error.h"
#include "bus-util.h"
+#include "escape.h"
+#include "fd-util.h"
#include "fileio.h"
#include "formats-util.h"
#include "hashmap.h"
+#include "machine-dbus.h"
+#include "machine.h"
#include "mkdir.h"
#include "special.h"
#include "terminal-util.h"
#include "unit-name.h"
#include "util.h"
-#include "machine-dbus.h"
-#include "machine.h"
Machine* machine_new(Manager *manager, MachineClass class, const char *name) {
Machine *m;
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index d7e0395690..23cc74ab54 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -40,6 +40,7 @@
#include "copy.h"
#include "env-util.h"
#include "event-util.h"
+#include "fd-util.h"
#include "hostname-util.h"
#include "import-util.h"
#include "log.h"
@@ -1092,9 +1093,10 @@ static int copy_files(int argc, char *argv[], void *userdata) {
container_path = copy_from ? argv[2] : dest;
if (!path_is_absolute(host_path)) {
- abs_host_path = path_make_absolute_cwd(host_path);
- if (!abs_host_path)
- return log_oom();
+ r = path_make_absolute_cwd(host_path, &abs_host_path);
+ if (r < 0)
+ return log_error_errno(r, "Failed to make path absolute: %m");
+
host_path = abs_host_path;
}
@@ -1110,10 +1112,8 @@ static int copy_files(int argc, char *argv[], void *userdata) {
argv[1],
copy_from ? container_path : host_path,
copy_from ? host_path : container_path);
- if (r < 0) {
- log_error("Failed to copy: %s", bus_error_message(&error, -r));
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Failed to copy: %s", bus_error_message(&error, r));
return 0;
}
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 6e4c72e8a9..b5ce6cdca2 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -24,21 +24,23 @@
#include <unistd.h>
#include "sd-id128.h"
-#include "strv.h"
-#include "path-util.h"
-#include "unit-name.h"
-#include "bus-util.h"
+
+#include "btrfs-util.h"
#include "bus-common-errors.h"
+#include "bus-util.h"
#include "cgroup-util.h"
-#include "btrfs-util.h"
+#include "fd-util.h"
#include "formats-util.h"
-#include "process-util.h"
#include "hostname-util.h"
+#include "image-dbus.h"
+#include "machine-dbus.h"
#include "machine-image.h"
#include "machine-pool.h"
-#include "image-dbus.h"
#include "machined.h"
-#include "machine-dbus.h"
+#include "path-util.h"
+#include "process-util.h"
+#include "strv.h"
+#include "unit-name.h"
static int property_get_pool_path(
sd_bus *bus,
diff --git a/src/machine/machined.c b/src/machine/machined.c
index df3cc9972a..fe229c88a8 100644
--- a/src/machine/machined.c
+++ b/src/machine/machined.c
@@ -24,15 +24,17 @@
#include <unistd.h>
#include "sd-daemon.h"
-#include "cgroup-util.h"
-#include "bus-util.h"
+
#include "bus-error.h"
-#include "label.h"
+#include "bus-util.h"
+#include "cgroup-util.h"
+#include "fd-util.h"
#include "formats-util.h"
-#include "signal-util.h"
#include "hostname-util.h"
+#include "label.h"
#include "machine-image.h"
#include "machined.h"
+#include "signal-util.h"
Manager *manager_new(void) {
Manager *m;
diff --git a/src/machine/machined.h b/src/machine/machined.h
index b3e59bf998..dac7a29ed1 100644
--- a/src/machine/machined.h
+++ b/src/machine/machined.h
@@ -23,10 +23,11 @@
#include <stdbool.h>
-#include "list.h"
-#include "hashmap.h"
-#include "sd-event.h"
#include "sd-bus.h"
+#include "sd-event.h"
+
+#include "hashmap.h"
+#include "list.h"
typedef struct Manager Manager;