[PATCH] D151567: [LLVM][Support] Report EISDIR when opening a directory on AIX

Alison Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 10:30:42 PDT 2023


azhan92 added inline comments.


================
Comment at: llvm/lib/Support/CommandLine.cpp:1312
+                               Twine("cannot not open file '") + FName +
+                                   "': Is a directory");
+    }
----------------
hubert.reinterpretcast wrote:
> @azhan92, how was the string (`"': Is a directory"`) determined in terms of the text and capitalization? I ask because `strerror` on different platforms may return different text (for example, may include message catalogue numbers or use different capitalization).
I used that string because that's the message used on Linux, and also what this lit test expects (https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/response-file-errs.c). 


================
Comment at: llvm/lib/Support/CommandLine.cpp:1311
+      return createStringError(std::make_error_code(std::errc::is_a_directory),
+                               Twine("cannot not open file ") + FName +
+                                   ": Is a directory.");
----------------
sepavloff wrote:
> I think putting single quotes around file name (as in the call of `createStringError` above) would fix failing test.
Yes I think you're right, thank you!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151567/new/

https://reviews.llvm.org/D151567



More information about the llvm-commits mailing list