[PATCH] D54677: [hurd] Fix unconditional use of PATH_MAX

Samuel Thibault via Phabricator reviews at reviews.llvm.org
Mon Nov 19 13:33:47 PST 2018


sthibaul added inline comments.


================
Comment at: src/filesystem/operations.cpp:533
   path p = __do_absolute(orig_p, &cwd, ec);
+#if _POSIX_VERSION >= 200112 || defined(__GLIBC__)
+  char *buff;
----------------
ldionne wrote:
> Is the extension available on old glibc's? Should that be `#if _POSIX_VERSION >= 200112 && defined(__GLIBC__)`, or just `#if _POSIX_VERSION >= 200112`?
The extension was added to glibc in 1996. Do we need to care about that old a version? :)

We could also just keep _POSIX_VERSION >= 200112 only, which was defined in glibc in 2003.


================
Comment at: src/filesystem/operations.cpp:535
+  char *buff;
+  if ((buff = ::realpath(p.c_str(), NULL)) == nullptr)
+    return err.report(capture_errno());
----------------
ldionne wrote:
> You could just initialize `char *buff = ::realpath(...)` and then make the check in the `if`?
Well, sure, I was just following the coding style below, what do you prefer?


Repository:
  rCXX libc++

https://reviews.llvm.org/D54677





More information about the libcxx-commits mailing list