sal/osl/unx/file_misc.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
New commits: commit 1c8ad4c95bd99dc6f8a105c109c725cbe92def26 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Aug 16 09:00:46 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Aug 23 12:37:54 2022 +0200 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 <caol...@redhat.com> 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 )