diff options
author | Bogdan Buzea <buzea.bogdan@libreoffice.org> | 2024-10-21 16:45:45 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-10-22 21:36:40 +0200 |
commit | a9b36e7af40b20ed75c9ff93e2f108a2d49265da (patch) | |
tree | 995a4f5d19339f1da30e9c5664a07a0637caa5a6 | |
parent | 746f66f4b1062f604cd1cfc638508c79477e13ee (diff) |
tdf#163486: PVS: Identical branches
V1037 Two or more case-branches perform the same actions. Check lines: 341, 345, 348
V1037 Two or more case-branches perform the same actions. Check lines: 481, 487
V1037 Two or more case-branches perform the same actions. Check lines: 689, 700
Change-Id: Ib9f4b8047f7706667f79de0170a672818ffd9030
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175346
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | ucb/source/ucp/file/filglob.cxx | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index c25f21789313..7f10f8e5fe00 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -336,14 +336,8 @@ namespace fileaccess { // not enough memory for allocating structures ioErrorCode = IOErrorCode_OUT_OF_MEMORY; break; - case FileBase::E_BUSY: - // Text file busy - ioErrorCode = IOErrorCode_LOCKING_VIOLATION; - break; - case FileBase::E_AGAIN: - // Operation would block - ioErrorCode = IOErrorCode_LOCKING_VIOLATION; - break; + case FileBase::E_BUSY: // Text file busy + case FileBase::E_AGAIN: // Operation would block case FileBase::E_NOLCK: // No record locks available ioErrorCode = IOErrorCode_LOCKING_VIOLATION; break; @@ -476,16 +470,13 @@ namespace fileaccess { // Is a directory ioErrorCode = IOErrorCode_NO_FILE; break; - case FileBase::E_AGAIN: - // Operation would block + case FileBase::E_AGAIN: // Operation would block + case FileBase::E_NOLCK: // No record locks available ioErrorCode = IOErrorCode_LOCKING_VIOLATION; break; case FileBase::E_TIMEDOUT: ioErrorCode = IOErrorCode_DEVICE_NOT_READY; break; - case FileBase::E_NOLCK: // No record locks available - ioErrorCode = IOErrorCode_LOCKING_VIOLATION; - break; case FileBase::E_IO: // I/O error case FileBase::E_BADF: // Bad file case FileBase::E_FAULT: // Bad address @@ -686,6 +677,8 @@ namespace fileaccess { ioErrorCode = IOErrorCode_ACCESS_DENIED; break; case FileBase::E_PERM: // Operation not permitted + case FileBase::E_ISDIR: // Is a directory + case FileBase::E_ROFS: // Read-only file system ioErrorCode = IOErrorCode_NOT_SUPPORTED; break; case FileBase::E_NAMETOOLONG: // File name too long @@ -695,10 +688,6 @@ namespace fileaccess { case FileBase::E_NOENT: // No such file or directory ioErrorCode = IOErrorCode_NOT_EXISTING; break; - case FileBase::E_ISDIR: // Is a directory - case FileBase::E_ROFS: // Read-only file system - ioErrorCode = IOErrorCode_NOT_SUPPORTED; - break; case FileBase::E_BUSY: // Device or resource busy ioErrorCode = IOErrorCode_LOCKING_VIOLATION; break; |