X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flogin%2Flogind.c;h=de6fbfbd442ea97c0b025e76b208748cdfdba5e0;hp=755d0be21a87384712c3226b2fe7256d98cbafb8;hb=c40fa3382a1b90aa5bccf2b36276e717461b11b0;hpb=1dcc35973e70aa02beb37fcc9d289053c264eef1 diff --git a/src/login/logind.c b/src/login/logind.c index 755d0be21..de6fbfbd4 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -1130,9 +1130,21 @@ int main(int argc, char *argv[]) { * existence of /run/systemd/seats/ to determine whether * logind is available, so please always make sure this check * stays in. */ - mkdir_label("/run/systemd/seats", 0755); - mkdir_label("/run/systemd/users", 0755); - mkdir_label("/run/systemd/sessions", 0755); + r = mkdir_label("/run/systemd", 0755); + if ( (r < 0) && (-EEXIST != r) ) + return log_error_errno(r, "Failed to create /run/systemd : %m"); + r = mkdir_label("/run/systemd/seats", 0755); + if ( r < 0 && (-EEXIST != r) ) + return log_error_errno(r, "Failed to create /run/systemd/seats : %m"); + r = mkdir_label("/run/systemd/users", 0755); + if ( r < 0 && (-EEXIST != r) ) + return log_error_errno(r, "Failed to create /run/systemd/users : %m"); + r = mkdir_label("/run/systemd/sessions", 0755); + if ( r < 0 && (-EEXIST != r) ) + return log_error_errno(r, "Failed to create /run/systemd/sessions : %m"); + r = mkdir_label("/run/systemd/machines", 0755); + if ( r < 0 && (-EEXIST != r) ) + return log_error_errno(r, "Failed to create /run/systemd/machines : %m"); m = manager_new(); if (!m) {