user-sessions.c revision 7fb3ee51c1b37738fd0ea2c81dfd6c336144698a
/*-*- 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 "fileio.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;
if (r < 0)
} else {
goto finish;
}
ret = EXIT_SUCCESS;
return ret;
}