assert(id);
lseek(fd, 0, SEEK_SET);
- if (loop_write(fd, id, 33, false) == 33)
+ if (loop_write(fd, id, 33, false) == 0)
return 0;
return -errno;
r = path_is_mount_point(etc_machine_id, false);
if (r < 0)
- return log_error_errno(r, "Failed to determine wether %s is a mount point: %m", etc_machine_id);
+ return log_error_errno(r, "Failed to determine whether %s is a mount point: %m", etc_machine_id);
if (r == 0) {
log_debug("%s is is not a mount point. Nothing to do.", etc_machine_id);
return 0;
if (r < 0)
return r;
- if (S_ISREG(st.st_mode) && writable) {
+ if (S_ISREG(st.st_mode) && writable)
if (write_machine_id(fd, id) == 0)
return 0;
- }
fd = safe_close(fd);