backlight.c revision 1ca208fb4f93e5869704af1812cbff7130a2fc03
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 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 "util.h"
#include "mkdir.h"
#include "fileio.h"
#include "libudev.h"
#include "udev-util.h"
int r;
if (argc != 3) {
log_error("This program requires two arguments.");
return EXIT_FAILURE;
}
log_open();
umask(0022);
if (r < 0) {
return EXIT_FAILURE;
}
if (!udev) {
log_oom();
return EXIT_FAILURE;
}
errno = 0;
if (!device)
if (!device) {
if (errno != 0)
else
r = log_oom();
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
if (!saved) {
log_oom();
return EXIT_FAILURE;
}
if (r < 0) {
if (r == -ENOENT)
return EXIT_SUCCESS;
return EXIT_FAILURE;
}
if (r < 0) {
return EXIT_FAILURE;
}
const char *value;
if (!value) {
return EXIT_FAILURE;
}
if (r < 0) {
return EXIT_FAILURE;
}
} else {
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}