Skip to content

Commit

Permalink
Make this piece work on both Windows and Linux
Browse files Browse the repository at this point in the history
Windows says it only reports a non-zero error code.  Effectively,
it is -1, but let's rather be save than sorry.
  • Loading branch information
mjklemm committed Jul 12, 2024
1 parent 96802cf commit fa5e899
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flang/runtime/misc-intrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fa5e899

Please sign in to comment.