version 1.31, 2015/01/20 23:14:00 |
version 1.32, 2015/12/26 20:51:35 |
|
|
if (fd < 0) |
if (fd < 0) |
return 0; |
return 0; |
|
|
pos = (long) uid * sizeof(ll); |
pos = (off_t)uid * sizeof(ll); |
r = lseek(fd, pos, SEEK_SET); |
r = lseek(fd, pos, SEEK_SET); |
if (r == -1) { |
if (r == -1) { |
error("%s: lseek: %s", __func__, strerror(errno)); |
error("%s: lseek: %s", __func__, strerror(errno)); |
|
|
strncpy(ll.ll_host, host, sizeof(ll.ll_host)); |
strncpy(ll.ll_host, host, sizeof(ll.ll_host)); |
fd = open(lastlog, O_RDWR); |
fd = open(lastlog, O_RDWR); |
if (fd >= 0) { |
if (fd >= 0) { |
lseek(fd, (off_t) ((long) uid * sizeof(ll)), SEEK_SET); |
lseek(fd, (off_t)uid * sizeof(ll), SEEK_SET); |
if (write(fd, &ll, sizeof(ll)) != sizeof(ll)) |
if (write(fd, &ll, sizeof(ll)) != sizeof(ll)) |
logit("Could not write %.100s: %.100s", lastlog, strerror(errno)); |
logit("Could not write %.100s: %.100s", lastlog, strerror(errno)); |
close(fd); |
close(fd); |