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

Louis Dionne via Phabricator reviews at reviews.llvm.org
Mon Nov 19 15:31:14 PST 2018


ldionne added inline comments.


================
Comment at: src/filesystem/operations.cpp:1089
+  struct stat sb;
+  if (lstat(p.c_str(), &sb) == -1) {
+    return err.report(capture_errno());
----------------
Is `lstat` always available? Also, you should use `::lstat` for consistency with the rest of the code.


================
Comment at: src/filesystem/operations.cpp:1093
+  size_t size = sb.st_size + 1;
+  char *buff = (char*) malloc(size);
+  if (buff == NULL) {
----------------
Is the reason why you're not using a `std::unique_ptr<char[]>` here because you don't want it to throw in case of no memory?


Repository:
  rCXX libc++

https://reviews.llvm.org/D54677





More information about the libcxx-commits mailing list