From fa5e899b49b9835793856a08bd456e72ad4a1e99 Mon Sep 17 00:00:00 2001 From: Michael Klemm Date: Thu, 11 Jul 2024 15:04:31 +0200 Subject: [PATCH] Make this piece work on both Windows and Linux Windows says it only reports a non-zero error code. Effectively, it is -1, but let's rather be save than sorry. --- flang/runtime/misc-intrinsic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flang/runtime/misc-intrinsic.cpp b/flang/runtime/misc-intrinsic.cpp index b4248203266f8b..9008944608e2e2 100644 --- a/flang/runtime/misc-intrinsic.cpp +++ b/flang/runtime/misc-intrinsic.cpp @@ -70,7 +70,7 @@ void RTDECL(Rename)(const Descriptor &path1, const Descriptor &path2, if (status) { // When an error has happened, int errorCode = 0; // Assume success - if (result < 0) { + if (result != 0) { // The rename operation has failed, so return the error code as status. errorCode = errno; }