[PATCH] D101904: [SystemZ][z/OS] Fix return values in AutoConversion functions
Abhina Sree via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 5 06:43:22 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6a12875046fd: [SystemZ][z/OS] Fix return values in AutoConversion functions (authored by abhina.sreeskantharajan).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101904/new/
https://reviews.llvm.org/D101904
Files:
llvm/lib/Support/AutoConvert.cpp
Index: llvm/lib/Support/AutoConvert.cpp
===================================================================
--- llvm/lib/Support/AutoConvert.cpp
+++ llvm/lib/Support/AutoConvert.cpp
@@ -23,7 +23,9 @@
0, // pccsid
(short)FT_BINARY, // fccsid
};
- return fcntl(FD, F_CONTROL_CVT, &Convert);
+ if (fcntl(FD, F_CONTROL_CVT, &Convert) == -1)
+ return std::error_code(errno, std::generic_category());
+ return std::error_code();
}
std::error_code llvm::enableAutoConversion(int FD) {
@@ -34,7 +36,7 @@
};
if (fcntl(FD, F_CONTROL_CVT, &Query) == -1)
- return -1;
+ return std::error_code(errno, std::generic_category());
Query.cvtcmd = SETCVTALL;
Query.pccsid =
@@ -43,7 +45,9 @@
: CCSID_UTF_8;
// Assume untagged files to be IBM-1047 encoded.
Query.fccsid = (Query.fccsid == FT_UNTAGGED) ? CCSID_IBM_1047 : Query.fccsid;
- return fcntl(FD, F_CONTROL_CVT, &Query);
+ if (fcntl(FD, F_CONTROL_CVT, &Query) == -1)
+ return std::error_code(errno, std::generic_category());
+ return std::error_code();
}
std::error_code llvm::setFileTag(int FD, int CCSID, bool Text) {
@@ -55,7 +59,9 @@
Tag.ft_deferred = 0;
Tag.ft_rsvflags = 0;
- return fcntl(FD, F_SETTAG, &Tag);
+ if (fcntl(FD, F_SETTAG, &Tag) == -1)
+ return std::error_code(errno, std::generic_category());
+ return std::error_code();
}
#endif // __MVS__
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101904.343028.patch
Type: text/x-patch
Size: 1407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210505/eb27d154/attachment.bin>
More information about the llvm-commits
mailing list