Commit ff5c9335 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 9

lseek returns the new offset, not 0

Summary:
With how this was written it would fail if the call to `lseek` failed, or if it succeeded, unless it was setting the length to 0, in which case it would succeed.
This makes it work right.

Reviewed By: yfeldblum

Differential Revision: D3773311

fbshipit-source-id: 3dc94502d0c4259f6f2766b4c0903c081d7c36ab
parent 19c6708b
......@@ -92,7 +92,7 @@ int fsync(int fd) {
}
int ftruncate(int fd, off_t len) {
if (_lseek(fd, len, SEEK_SET)) {
if (_lseek(fd, len, SEEK_SET) == -1) {
return -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment