diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-08-16 09:00:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-08-23 12:37:54 +0200 |
commit | 1c8ad4c95bd99dc6f8a105c109c725cbe92def26 (patch) | |
tree | 8f1524de1f1922337ab798aaca59749b90632739 /sal/osl/unx | |
parent | 3f284b6f12e3eb047398998b223663b38a9bfec8 (diff) |
cid#1509185 Logically dead code
do oslDoCopyFile only for S_ISREG. openFilePath (called from oslDoCopyFile)
returns osl_File_E_INVAL for !S_ISREG so use EINVAL as the error code here
to produce osl_File_E_INVAL too.
Change-Id: I25a6c091799e051fe58c7dbfc2e7e062f16fe517
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138342
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal/osl/unx')
-rw-r--r-- | sal/osl/unx/file_misc.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index b2d6010fe847..c411b78cc260 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -850,21 +850,18 @@ static oslFileError oslDoCopy(const char* pszSourceFileName, const char* pszDest } } - /* mfe: should be S_ISREG */ - if ( !S_ISLNK(nMode) ) + if ( S_ISREG(nMode) ) { /* copy SourceFile to DestFile */ nRet = oslDoCopyFile(pszSourceFileName,pszDestFileName,nSourceSize, nMode); } - /* mfe: OK redundant at the moment */ else if ( S_ISLNK(nMode) ) { nRet = oslDoCopyLink(pszSourceFileName,pszDestFileName); } else { - /* mfe: what to do here? */ - nRet=ENOSYS; + nRet = EINVAL; } if ( nRet > 0 && DestFileExists ) |