Browse Source

Removed extraneous compiler warnings about unused return values.


git-svn-id: https://svn.microneil.com/svn/CodeDweller/branches/adeniz_1@107 d34b734f-a00e-4b39-a726-e4eeb87269ab
adeniz_1
adeniz 9 years ago
parent
commit
c4836264a8
1 changed files with 13 additions and 9 deletions
  1. 13
    9
      child.cpp

+ 13
- 9
child.cpp View File

#include <cstring> #include <cstring>
#include <cerrno> #include <cerrno>
/// Dummy used to suppressed warnings about unused values.
int iDummy;
#endif #endif
#include <stdexcept> #include <stdexcept>
// Send message to parent. // Send message to parent.
errMsg = "Error redirecting stdin in the child: " + getErrorText(); errMsg = "Error redirecting stdin in the child: " + getErrorText();
::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
// Send message to parent. // Send message to parent.
errMsg = "Error redirecting stdout in the child: " + getErrorText(); errMsg = "Error redirecting stdout in the child: " + getErrorText();
::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
// Send message to parent. // Send message to parent.
errMsg = "Error closing the pipes in the child: " + getErrorText(); errMsg = "Error closing the pipes in the child: " + getErrorText();
::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
// Send message to parent. // Send message to parent.
errMsg = "Error from exec: " + getErrorText(); errMsg = "Error from exec: " + getErrorText();
::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
// Send message to parent. // Send message to parent.
errMsg = "Error redirecting stdin in the child: " + getErrorText(); errMsg = "Error redirecting stdin in the child: " + getErrorText();
::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
// Send message to parent. // Send message to parent.
errMsg = "Error redirecting stdout in the child: " + getErrorText(); errMsg = "Error redirecting stdout in the child: " + getErrorText();
::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
// Send message to parent. // Send message to parent.
errMsg = "Error redirecting stderr in the child: " + getErrorText(); errMsg = "Error redirecting stderr in the child: " + getErrorText();
::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
iDummy = ::write(childStdOutPipe[1], errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
// Send message to parent. // Send message to parent.
errMsg = "Error closing the pipes in the child: " + getErrorText(); errMsg = "Error closing the pipes in the child: " + getErrorText();
::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }
errMsg = "Error (from exec) running the command \""; errMsg = "Error (from exec) running the command \"";
errMsg += execvArgv[0]; errMsg += execvArgv[0];
errMsg += ": " + getErrorText(); errMsg += ": " + getErrorText();
::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
iDummy = ::write(STDOUT_FILENO, errMsg.data(), errMsg.size());
exit(-1); exit(-1);
} }

Loading…
Cancel
Save