diff options
author | Hallvard B Furuseth <h.b.furuseth@usit.uio.no> | 1997-09-05 00:00:00 +0000 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-09-05 00:00:00 +1200 |
commit | 08b714dde408c78ef493825678e6902b5f19f3b0 (patch) | |
tree | 2854f0b3e0658748afe485374eae6ab93cfc4805 | |
parent | 08ea043f90d6fea4e1b9bc32f82e31d999c4b3d1 (diff) | |
download | perl-08b714dde408c78ef493825678e6902b5f19f3b0.tar.gz |
Further fix to lseek's in lockf_emulate_flock
private-msgid: 199708102225.AAA16970@bombur2.uio.no
-rw-r--r-- | pp_sys.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4381,7 +4381,8 @@ int operation; save_errno = errno; pos = lseek(fd, (Off_t)0, SEEK_CUR); /* get pos to restore later */ if (pos > 0) /* is seekable and needs to be repositioned */ - lseek(fd, (Off_t)0, SEEK_SET); + if (lseek(fd, (Off_t)0, SEEK_SET) < 0) + pos = -1; /* seek failed, so don't seek back afterwards */ errno = save_errno; switch (operation) { @@ -4417,8 +4418,7 @@ int operation; } if (pos > 0) /* need to restore position of the handle */ - if (lseek(fd, pos, SEEK_SET) == -1) - i = -1; + lseek(fd, pos, SEEK_SET); /* ignore error here */ return (i); } |