From: Mukund Sivaraman Date: Thu, 24 May 2012 05:49:59 +0000 (+0530) Subject: [1704] fd_ cannot be -1 here X-Git-Tag: trac2351_base~226^2~60^2^2~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db2fa0cd177d28c49a9c99aabe44bd9c47c6b78d;p=thirdparty%2Fkea.git [1704] fd_ cannot be -1 here --- diff --git a/src/lib/util/interprocess_sync_file.cc b/src/lib/util/interprocess_sync_file.cc index bb31745a24..197b63f6d3 100644 --- a/src/lib/util/interprocess_sync_file.cc +++ b/src/lib/util/interprocess_sync_file.cc @@ -87,7 +87,7 @@ InterprocessSyncFile::lock() { return (true); } - if ((fd_ != -1) && do_lock(fd_, F_SETLKW, F_WRLCK)) { + if (do_lock(fd_, F_SETLKW, F_WRLCK)) { is_locked_ = true; return (true); } @@ -101,7 +101,7 @@ InterprocessSyncFile::tryLock() { return (true); } - if ((fd_ != -1) && do_lock(fd_, F_SETLK, F_WRLCK)) { + if (do_lock(fd_, F_SETLK, F_WRLCK)) { is_locked_ = true; return (true); } @@ -115,7 +115,7 @@ InterprocessSyncFile::unlock() { return (true); } - if ((fd_ != -1) && do_lock(fd_, F_SETLKW, F_UNLCK)) { + if (do_lock(fd_, F_SETLKW, F_UNLCK)) { is_locked_ = false; return (true); }