From bfa5d77211385cd8abe5d0833f84a8151ccab37d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 6 Jul 2003 15:08:39 +0000 Subject: [PATCH] * Bug fix: properly check result of open(). --- src/archive.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/archive.cc b/src/archive.cc index d0cf6ca34a..7e07b8a08b 100644 --- a/src/archive.cc +++ b/src/archive.cc @@ -87,7 +87,7 @@ static void dumpContents(const string & path, unsigned int size, writeInt(size, sink); int fd = open(path.c_str(), O_RDONLY); - if (!fd) throw SysError("opening file " + path); + if (fd == -1) throw SysError("opening file " + path); unsigned char buf[65536];