From 288239096789be4c1b9bd418d633ddf6836eb9f1 Mon Sep 17 00:00:00 2001 From: anjakefala Date: Fri, 5 Jan 2024 11:42:50 -0800 Subject: [PATCH] GH-39385: [C++] Use more permissable return code for rename --- cpp/src/arrow/filesystem/localfs.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/arrow/filesystem/localfs.cc b/cpp/src/arrow/filesystem/localfs.cc index d440629a02496..01ac946379119 100644 --- a/cpp/src/arrow/filesystem/localfs.cc +++ b/cpp/src/arrow/filesystem/localfs.cc @@ -595,7 +595,7 @@ Status LocalFileSystem::Move(const std::string& src, const std::string& dest) { "' to '", dfn.ToString(), "'"); } #else - if (rename(sfn.ToNative().c_str(), dfn.ToNative().c_str()) == -1) { + if (rename(sfn.ToNative().c_str(), dfn.ToNative().c_str()) != 0) { return IOErrorFromErrno(errno, "Failed renaming '", sfn.ToString(), "' to '", dfn.ToString(), "'"); }