* set 'sticky' bit to indicate that we should not clean the
* database when we transition from initramfs to the real root
*/
- if (device->db_persist) {
- r = fchmod(fileno(f), 01644);
- if (r < 0) {
- r = -errno;
- goto fail;
- }
- } else {
- r = fchmod(fileno(f), 0644);
- if (r < 0) {
- r = -errno;
- goto fail;
- }
+ if (fchmod(fileno(f), device->db_persist ? 01644 : 0644) < 0) {
+ r = -errno;
+ goto fail;
}
if (has_info) {
if (r < 0)
goto fail;
- r = rename(path_tmp, path);
- if (r < 0) {
+ if (rename(path_tmp, path) < 0) {
r = -errno;
goto fail;
}