From a9b36e7af40b20ed75c9ff93e2f108a2d49265da Mon Sep 17 00:00:00 2001 From: Bogdan Buzea Date: Mon, 21 Oct 2024 16:45:45 +0200 Subject: 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 --- ucb/source/ucp/file/filglob.cxx | 23 ++++++----------------- 1 file 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; -- cgit