ソースを参照

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 11年前
親
コミット
c4836264a8
1個のファイルの変更、13行の追加、9行の削除
  1. 13
    9
      child.cpp

+ 13
- 9
child.cpp ファイルの表示

#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);
} }

読み込み中…
キャンセル
保存