commit | ec76f15a4ae995c06db6c6dda6a6fa41b189f613 | [log] [tgz] |
---|---|---|
author | Jens Axboe <jens.axboe@oracle.com> | Tue Jun 09 13:05:32 2009 +0200 |
committer | Jens Axboe <jens.axboe@oracle.com> | Tue Jun 09 13:05:32 2009 +0200 |
tree | 87a1004b10c93383d5f590a5d941c10120274363 | |
parent | cf2dd8d64f1211a24341a296c56a671593bce7a4 [diff] [blame] |
Fix fd leak in cache line checking Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/os/os-linux.h b/os/os-linux.h index 1cd8272..b766cbf 100644 --- a/os/os-linux.h +++ b/os/os-linux.h
@@ -263,10 +263,13 @@ return -1; ret = read(fd, size, sizeof(size)); + + close(fd); + if (ret <= 0) return -1; - - return atoi(size); + else + return atoi(size); } #endif