commit | 269df4664051504b8f543ef3154f601ab8ee5458 | [log] [tgz] |
---|---|---|
author | Logan <tzuhsiang.chien@gmail.com> | Fri Jan 07 12:51:48 2011 +0800 |
committer | Logan <tzuhsiang.chien@gmail.com> | Fri Jan 07 12:51:48 2011 +0800 |
tree | a2f4c2040d10a5bddd146d53927c185636618b58 | |
parent | 216ec7157e6f4ff946ee640895e9b9c466977a86 [diff] [blame] |
Change the order of close(fd) and flock(fd, LOCK_UN)
diff --git a/lib/bcc/FileHandle.cpp b/lib/bcc/FileHandle.cpp index e19d0d1..8ec194a 100644 --- a/lib/bcc/FileHandle.cpp +++ b/lib/bcc/FileHandle.cpp
@@ -93,6 +93,7 @@ } // Good, we have open and lock the file correctly. + LOGI("File opened. fd=%d\n", mFD); return mFD; } @@ -103,8 +104,9 @@ void FileHandle::close() { if (mFD >= 0) { - ::close(mFD); flock(mFD, LOCK_UN); + ::close(mFD); + LOGI("File closed. fd=%d\n", mFD); mFD = -1; } }