diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-30 19:35:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-03 08:41:11 +0200 |
commit | d3971ec256450e6783920b46f672048b29719949 (patch) | |
tree | f4722d0e2bc321cf71b49b7573cf38640e9b28fc /sal/osl | |
parent | f50bf3c5225b49b3c6f77f882e35305e5dc5ccd3 (diff) |
new loplugin:blockblock
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd
Reviewed-on: https://gerrit.libreoffice.org/43025
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/unx/file.cxx | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index f2b594f8a3e6..4c62c8ec4bd5 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -1019,22 +1019,20 @@ oslFileError openFilePath(const char *cpFilePath, oslFileHandle* pHandle, sal_uI } } #else /* F_SETLK */ - { - struct flock aflock; + struct flock aflock; - aflock.l_type = F_WRLCK; - aflock.l_whence = SEEK_SET; - aflock.l_start = 0; - aflock.l_len = 0; + aflock.l_type = F_WRLCK; + aflock.l_whence = SEEK_SET; + aflock.l_start = 0; + aflock.l_len = 0; - if (fcntl(fd, F_SETLK, &aflock) == -1) - { - int saved_errno = errno; - SAL_INFO("sal.file", "osl_openFile(" << cpFilePath << ", " << ((flags & O_RDWR) ? "writeable":"readonly") << "): fcntl(" << fd << ", F_SETLK) failed: " << strerror(saved_errno)); - eRet = oslTranslateFileError(OSL_FET_ERROR, saved_errno); - (void) close(fd); - return eRet; - } + if (fcntl(fd, F_SETLK, &aflock) == -1) + { + int saved_errno = errno; + SAL_INFO("sal.file", "osl_openFile(" << cpFilePath << ", " << ((flags & O_RDWR) ? "writeable":"readonly") << "): fcntl(" << fd << ", F_SETLK) failed: " << strerror(saved_errno)); + eRet = oslTranslateFileError(OSL_FET_ERROR, saved_errno); + (void) close(fd); + return eRet; } #endif /* F_SETLK */ } |