user-sessions.c revision 5430f7f2bc7330f3088b894166bf3524a067e3d8
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include "log.h"
#include "util.h"
#include "cgroup-util.h"
int ret = EXIT_FAILURE;
if (argc != 2) {
log_error("This program requires one argument.");
return EXIT_FAILURE;
}
log_open();
umask(0022);
int q = 0, r = 0;
r = -errno;
}
/* If the file doesn't exist and /etc simply
* was read-only (in which case unlink()
* returns EROFS even if the file doesn't
* exist), don't complain */
q = -errno;
}
}
if (r < 0 || q < 0)
goto finish;
int r, q;
char *cgroup_user_tree = NULL;
if ((q = cg_get_user_path(&cgroup_user_tree)) < 0) {
goto finish;
}
if (q < 0) {
goto finish;
}
if (r < 0)
goto finish;
} else {
goto finish;
}
ret = EXIT_SUCCESS;
return ret;
}