chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "tree-wide: Always use recvmsg with MSG_CMSG_CLOEXEC"
[elogind.git]
/
src
/
machine
/
machinectl.c
diff --git
a/src/machine/machinectl.c
b/src/machine/machinectl.c
index 728cd42629fe41c7395d02bf5ad4035fd6e86e87..9f8c68b184f5b79ef4d589a19777d7a1dca49dff 100644
(file)
--- a/
src/machine/machinectl.c
+++ b/
src/machine/machinectl.c
@@
-31,8
+31,13
@@
#include <arpa/inet.h>
#include <net/if.h>
#include <sys/mount.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <sys/mount.h>
+
+/* When we include libgen.h because we need dirname() we immediately
+ * undefine basename() since libgen.h defines it as a macro to the XDG
+ * version which is really broken. */
#include <libgen.h>
#undef basename
#include <libgen.h>
#undef basename
+
#include "sd-bus.h"
#include "log.h"
#include "util.h"
#include "sd-bus.h"
#include "log.h"
#include "util.h"
@@
-1160,7
+1165,7
@@
static int bind_mount(int argc, char *argv[], void *userdata) {
return -EINVAL;
}
return -EINVAL;
}
- p = str
append
a("/run/systemd/nspawn/propagate/", argv[1], "/");
+ p = str
join
a("/run/systemd/nspawn/propagate/", argv[1], "/");
if (access(p, F_OK) < 0) {
log_error("Container does not allow propagation of mount points.");
return -ENOTSUP;
if (access(p, F_OK) < 0) {
log_error("Container does not allow propagation of mount points.");
return -ENOTSUP;
@@
-1198,7
+1203,7
@@
static int bind_mount(int argc, char *argv[], void *userdata) {
/* Second, we mount the source directory to a directory inside
of our MS_SLAVE playground. */
/* Second, we mount the source directory to a directory inside
of our MS_SLAVE playground. */
- mount_tmp = str
append
a(mount_slave, "/mount");
+ mount_tmp = str
join
a(mount_slave, "/mount");
if (mkdir(mount_tmp, 0700) < 0) {
r = log_error_errno(errno, "Failed to create temporary mount: %m");
goto finish;
if (mkdir(mount_tmp, 0700) < 0) {
r = log_error_errno(errno, "Failed to create temporary mount: %m");
goto finish;
@@
-1224,7
+1229,7
@@
static int bind_mount(int argc, char *argv[], void *userdata) {
* directory. This way it will appear there read-only
* right-away. */
* directory. This way it will appear there read-only
* right-away. */
- mount_outside = str
append
a("/run/systemd/nspawn/propagate/", argv[1], "/XXXXXX");
+ mount_outside = str
join
a("/run/systemd/nspawn/propagate/", argv[1], "/XXXXXX");
if (!mkdtemp(mount_outside)) {
r = log_error_errno(errno, "Cannot create propagation directory: %m");
goto finish;
if (!mkdtemp(mount_outside)) {
r = log_error_errno(errno, "Cannot create propagation directory: %m");
goto finish;
@@
-1276,7
+1281,7
@@
static int bind_mount(int argc, char *argv[], void *userdata) {
mkdir_p(dest, 0755);
/* Fifth, move the mount to the right place inside */
mkdir_p(dest, 0755);
/* Fifth, move the mount to the right place inside */
- mount_inside = str
append
a("/run/systemd/nspawn/incoming/", basename(mount_outside));
+ mount_inside = str
join
a("/run/systemd/nspawn/incoming/", basename(mount_outside));
if (mount(mount_inside, dest, NULL, MS_MOVE, NULL) < 0) {
log_error_errno(errno, "Failed to mount: %m");
_exit(EXIT_FAILURE);
if (mount(mount_inside, dest, NULL, MS_MOVE, NULL) < 0) {
log_error_errno(errno, "Failed to mount: %m");
_exit(EXIT_FAILURE);
@@
-1376,7
+1381,7
@@
static int login_machine(int argc, char *argv[], void *userdata) {
if (r < 0)
return log_error_errno(r, "Failed to attach bus to event loop: %m");
if (r < 0)
return log_error_errno(r, "Failed to attach bus to event loop: %m");
- match = str
append
a("type='signal',"
+ match = str
join
a("type='signal',"
"sender='org.freedesktop.machine1',"
"path='/org/freedesktop/machine1',",
"interface='org.freedesktop.machine1.Manager',"
"sender='org.freedesktop.machine1',"
"path='/org/freedesktop/machine1',",
"interface='org.freedesktop.machine1.Manager',"
@@
-1785,7
+1790,7
@@
static int transfer_signal_handler(sd_event_source *s, const struct signalfd_sig
assert(si);
if (!arg_quiet)
assert(si);
if (!arg_quiet)
- log_info("Continuing download in the background. Use \"machinectl cancel-transfer %" PRIu32 "\" to a
r
bort transfer.", PTR_TO_UINT32(userdata));
+ log_info("Continuing download in the background. Use \"machinectl cancel-transfer %" PRIu32 "\" to abort transfer.", PTR_TO_UINT32(userdata));
sd_event_exit(sd_event_source_get_event(s), EINTR);
return 0;
sd_event_exit(sd_event_source_get_event(s), EINTR);
return 0;
@@
-1995,7
+2000,6
@@
static int pull_raw(int argc, char *argv[], void *userdata) {
static int pull_dkr(int argc, char *argv[], void *userdata) {
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
static int pull_dkr(int argc, char *argv[], void *userdata) {
_cleanup_bus_message_unref_ sd_bus_message *m = NULL;
- _cleanup_free_ char *l = NULL, *ll = NULL;
const char *local, *remote, *tag;
sd_bus *bus = userdata;
int r;
const char *local, *remote, *tag;
sd_bus *bus = userdata;
int r;