along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
+#include "bus-internal.h"
+#include "bus-util.h"
+#include "cgroup-util.h"
#include "conf-parser.h"
-#include "special.h"
+#include "dirent-util.h"
+#include "fd-util.h"
+#include "fileio.h"
#include "mkdir.h"
-#include "bus-util.h"
-#include "bus-internal.h"
+#include "special.h"
#include "unit-name.h"
-#include "cgroup-util.h"
+#include "util.h"
static const char *arg_dest_late = "/tmp", *arg_dest = "/tmp";
fprintf(f, "Environment=DBUS_STARTER_BUS_TYPE=%s\n", type);
if (streq(type, "system"))
- fprintf(f, "Environment=DBUS_STARTER_ADDRESS=%s\n",
- is_kdbus_available() ? KERNEL_SYSTEM_BUS_ADDRESS : UNIX_SYSTEM_BUS_ADDRESS);
+ fprintf(f, "Environment=DBUS_STARTER_ADDRESS=" DEFAULT_SYSTEM_BUS_ADDRESS "\n");
else if (streq(type, "session")) {
char *run;
return -EINVAL;
}
- if (is_kdbus_available())
- fprintf(f, "Environment=DBUS_STARTER_ADDRESS="KERNEL_USER_BUS_ADDRESS_FMT "\n", getuid());
- else
- fprintf(f, "Environment=DBUS_STARTER_ADDRESS="UNIX_USER_BUS_ADDRESS_FMT "\n", run);
+ fprintf(f, "Environment=DBUS_STARTER_ADDRESS="KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT "\n",
+ getuid(), run);
}
}
if (r < 0)
return log_error_errno(r, "Failed to write %s: %m", a);
- fclose(f);
- f = NULL;
+ f = safe_fclose(f);
service = s;
}