update-done.c revision c004493cdefc1f43a3956ca529e8070f8d70be56
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2014 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 "fd-util.h"
#include "io-util.h"
#include "selinux-util.h"
#include "util.h"
#define MESSAGE \
"This file was created by systemd-update-done. Its only \n" \
"purpose is to hold a timestamp of the time this directory\n" \
"was updated. See systemd-update-done.service(8).\n"
*ts,
*ts
};
/* Is the timestamp file already newer than the OS? If
* so, there's nothing to do. We ignore the nanosecond
* component of the timestamp, since some file systems
* do not support any better accuracy than 1s and we
* have no way to identify the accuracy
* available. Most notably ext4 on small disks (where
* 128 byte inodes are used) does not support better
* accuracy than 1s. */
return 0;
/* It is older? Then let's update it */
}
int r;
/* The timestamp file doesn't exist yet? Then let's create it. */
if (r < 0)
if (fd < 0) {
}
} else
return 0;
}
int r, q = 0;
log_open();
return EXIT_FAILURE;
}
r = mac_selinux_init(NULL);
if (r < 0) {
log_error_errno(r, "SELinux setup failed: %m");
goto finish;
}
return r < 0 || q < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}