From 422ab3288e710070732048f4475438b93c053aab Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 2 Feb 2009 15:20:44 +0000 Subject: [PATCH] Make CExecSock generate error messages if execvp() fails to find sh I doubt this will ever happen, but let's better be sure... git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1362 726aef4b-f618-498e-8847-2d620e286838 --- FileUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FileUtils.cpp b/FileUtils.cpp index 5c7ed6b5..250efe11 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -550,7 +550,9 @@ int CExecSock::popen2(int & iReadFD, int & iWriteFD, const CString & sCommand) { NULL }; execvp("sh", (char * const *) pArgv); - exit(0); + // if execvp returns, there was an error + perror("execvp"); + exit(1); } close(wpipes[0]);