Repository: trafficserver Updated Branches: refs/heads/master 810d877db -> 4ed316a0c
Revert "TS-3287: Test for equality with zero on fd as well" This reverts commit 01121ce827e246496f74e0ce4ed8770b67cb524d. See https://issues.apache.org/jira/browse/TS-3377 for details. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/4ed316a0 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/4ed316a0 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/4ed316a0 Branch: refs/heads/master Commit: 4ed316a0cbd136e5f66205e2d363126ac86f90da Parents: 810d877 Author: Leif Hedstrom <[email protected]> Authored: Fri Feb 6 20:17:32 2015 -0700 Committer: Leif Hedstrom <[email protected]> Committed: Fri Feb 6 20:17:32 2015 -0700 ---------------------------------------------------------------------- iocore/cache/Cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4ed316a0/iocore/cache/Cache.cc ---------------------------------------------------------------------- diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc index af61fa5..cb2dde6 100644 --- a/iocore/cache/Cache.cc +++ b/iocore/cache/Cache.cc @@ -728,7 +728,7 @@ CacheProcessor::start_internal(int flags) if (fd < 0 && (opts & O_CREAT)) // Try without O_DIRECT if this is a file on filesystem, e.g. tmpfs. fd = open(path, DEFAULT_CACHE_OPTIONS | O_CREAT, 0644); - if (fd >= 0) { + if (fd > 0) { if (!sd->file_pathname) { if (ftruncate(fd, ((uint64_t) blocks) * STORE_BLOCK_SIZE) < 0) { Warning("unable to truncate cache file '%s' to %d blocks", path, blocks); @@ -773,7 +773,7 @@ CacheProcessor::start_internal(int flags) else Warning("cache unable to open '%s': %s", path, strerror(errno)); } - if (fd >= 0) { + if (fd > 0) { close(fd); } }
