+static int do_send_reload(const struct unitdesc descs[], unsigned count)
+{
+ unsigned i;
+ int reloadsys, reloadusr;
+
+ reloadsys = reloadusr = 0;
+ for (i = 0 ; i < count ; i++) {
+ if (descs[i].wanted_by != NULL) {
+ switch (descs[i].scope) {
+ case unitscope_user:
+ reloadusr = 1;
+ break;
+ case unitscope_system:
+ reloadsys = 1;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ if (reloadusr)
+ reloadusr = systemd_daemon_reload(1);
+ if (reloadsys)
+ reloadsys = systemd_daemon_reload(0);
+ return reloadsys ? : reloadusr ? : 0;
+}
+