char mode; /* H, P, r, i.e. the switches usually passed to
* shutdown to select whether to halt, power-off or
* reboot the machine */
+ bool dry_run;
bool warn_wall;
/* Yepp, sometimes we are lazy and use fixed-size strings like
return verbs[i].dispatch(bus, argv + optind, left);
}
-static int send_shutdownd(usec_t t, char mode, bool warn, const char *message) {
+static int send_shutdownd(usec_t t, char mode, bool dry_run, bool warn, const char *message) {
int fd = -1;
struct msghdr msghdr;
struct iovec iovec;
zero(c);
c.elapse = t;
c.mode = mode;
+ c.dry_run = dry_run;
c.warn_wall = warn;
if (message)
arg_action == ACTION_HALT ? 'H' :
arg_action == ACTION_POWEROFF ? 'P' :
'r',
+ arg_dry,
!arg_no_wall,
m);
free(m);
break;
case ACTION_CANCEL_SHUTDOWN:
- r = send_shutdownd(0, 0, false, NULL);
+ r = send_shutdownd(0, 0, false, false, NULL);
break;
case ACTION_INVALID: