build: Fix conditional compilation on availability of getpass()
Change-Id: I3aa95c1b6afe2239f24642507da8090f7f58abac
Refs: #2419
diff --git a/tools/ndnsec/unlock-tpm.hpp b/tools/ndnsec/unlock-tpm.hpp
index 607efb1..2127848 100644
--- a/tools/ndnsec/unlock-tpm.hpp
+++ b/tools/ndnsec/unlock-tpm.hpp
@@ -29,7 +29,7 @@
int
ndnsec_unlock_tpm(int argc, char** argv)
{
-#ifndef NDN_CXX_HAVE_GETPASS
+#ifdef NDN_CXX_HAVE_GETPASS
using namespace ndn;
namespace po = boost::program_options;
diff --git a/tools/ndnsec/util.hpp b/tools/ndnsec/util.hpp
index 2de9ff1..eaf2825 100644
--- a/tools/ndnsec/util.hpp
+++ b/tools/ndnsec/util.hpp
@@ -46,7 +46,7 @@
bool
getPassword(std::string& password, const std::string& prompt)
{
-#ifndef NDN_CXX_HAVE_GETPASS
+#ifdef NDN_CXX_HAVE_GETPASS
bool isReady = false;
char* pw0 = 0;