diff options
author | brian <brian@FreeBSD.org> | 2000-10-02 17:32:00 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-10-02 17:32:00 +0000 |
commit | effa2801c61cd844177ae8f8b75b763d14bfea72 (patch) | |
tree | 45dff79bbcf81d866e604f58e283709d9d9d2f14 /lib | |
parent | d4edaae88f77cb78f7e0d294fef285db9617bd9c (diff) | |
download | FreeBSD-src-effa2801c61cd844177ae8f8b75b763d14bfea72.zip FreeBSD-src-effa2801c61cd844177ae8f8b75b763d14bfea72.tar.gz |
Correct uu_lock_txfr. I don't think this ever worked correctly.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libutil/uucplock.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libutil/uucplock.c b/lib/libutil/uucplock.c index 012016a..a81d91a 100644 --- a/lib/libutil/uucplock.c +++ b/lib/libutil/uucplock.c @@ -139,13 +139,14 @@ uu_lock_txfr(const char *ttyname, pid_t pid) if ((fd = open(lckname, O_RDWR)) < 0) return UU_LOCK_OWNER_ERR; if (get_pid(fd, &err) != getpid()) - return UU_LOCK_OWNER_ERR; - lseek(fd, 0, SEEK_SET); - if (put_pid(fd, pid)) - return UU_LOCK_WRITE_ERR; + err = UU_LOCK_OWNER_ERR; + else { + lseek(fd, 0, SEEK_SET); + err = put_pid(fd, pid) ? 0 : UU_LOCK_WRITE_ERR; + } close(fd); - return UU_LOCK_OK; + return err; } int |