if (fd < 0)
return;
- if (lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET) == -1) {
- close(fd);
- return;
- }
+ if (lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET) == -1)
+ goto done;
/*
* Print last log message
printf(_("on %.*s\n"),
(int)sizeof(ll.ll_line), ll.ll_line);
}
- lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET);
+ if (lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET) == -1)
+ goto done;
}
memset((char *)&ll, 0, sizeof(ll));
if (write_all(fd, (char *)&ll, sizeof(ll)))
warn(_("write lastlog failed"));
-
+done:
close(fd);
}