# HG changeset patch # User Augie Fackler # Date 2019-12-06 20:30:29 # Node ID c78f8f0720cc4a102e0f43385aace85b3258e8ed # Parent acbb55b8e9dcb4f6c5ea5dfd49ad6d430726fdc4 fuzz: fix an unused result on getcwd() in pyutil clang was rightly complaining about this, so let's just fix it. Differential Revision: https://phab.mercurial-scm.org/D7558 diff --git a/contrib/fuzz/pyutil.cc b/contrib/fuzz/pyutil.cc --- a/contrib/fuzz/pyutil.cc +++ b/contrib/fuzz/pyutil.cc @@ -1,5 +1,6 @@ #include "pyutil.h" +#include #include namespace contrib @@ -24,7 +25,11 @@ void initpy(const char *cselfpath) auto pos = selfpath.rfind("/"); if (pos == std::string::npos) { char wd[8192]; - getcwd(wd, 8192); + if (!getcwd(wd, 8192)) { + std::cerr << "Failed to call getcwd: errno " << errno + << std::endl; + exit(1); + } pypath = std::string(wd) + subdir; } else { pypath = selfpath.substr(0, pos) + subdir;