along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <sys/socket.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <getopt.h>
#include <pwd.h>
#include <locale.h>
-#include <socket.h>
#include <fcntl.h>
#include "sd-bus.h"
*new_line = true;
- r = bus_print_all_properties(bus, path, arg_property, arg_all);
+ r = bus_print_all_properties(bus, "org.freedesktop.machine1", path, arg_property, arg_all);
if (r < 0)
log_error("Could not get properties: %s", strerror(-r));
_cleanup_close_ int nsfd = -1, rootfd = -1;
_cleanup_free_ char *ns = NULL, *root = NULL;
_cleanup_close_pipe_ int sock[2] = { -1, -1 };
- struct msghdr mh;
union {
struct cmsghdr cmsghdr;
uint8_t buf[CMSG_SPACE(sizeof(int))];
- } control;
+ } control = {};
+ struct msghdr mh = {
+ .msg_control = &control,
+ .msg_controllen = sizeof(control),
+ };
struct cmsghdr *cmsg;
int master = -1, r;
pid_t child;
if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sock) < 0)
return -errno;
- zero(control);
- zero(mh);
- mh.msg_control = &control;
- mh.msg_controllen = sizeof(control);
-
child = fork();
if (child < 0)
return -errno;
{ "host", required_argument, NULL, 'H' },
{ "machine", required_argument, NULL, 'M' },
{ "no-ask-password", no_argument, NULL, ARG_NO_ASK_PASSWORD },
- { NULL, 0, NULL, 0 }
+ {}
};
int c, r;
switch (c) {
case 'h':
- help();
- return 0;
+ return help();
case ARG_VERSION:
puts(PACKAGE_STRING);
return -EINVAL;
default:
- log_error("Unknown option code %c", c);
- return -EINVAL;
+ assert_not_reached("Unhandled option");
}
}