summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Daemon.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2008-04-23 18:01:49 +0000
committerAndrew Stitcher <astitcher@apache.org>2008-04-23 18:01:49 +0000
commit3d77fe97fac8498640f2f9b7706e4e465ea6886c (patch)
tree76cc9ce21775708b2f3ca3534068b41e9ad49723 /cpp/src/qpid/broker/Daemon.cpp
parent1934aec7e726b1af056f55d94890a67146324202 (diff)
downloadqpid-python-3d77fe97fac8498640f2f9b7706e4e465ea6886c.tar.gz
Patch from Mick Goulish: Fixes to previous improved portability patch
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@650970 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Daemon.cpp')
-rw-r--r--cpp/src/qpid/broker/Daemon.cpp41
1 files changed, 21 insertions, 20 deletions
diff --git a/cpp/src/qpid/broker/Daemon.cpp b/cpp/src/qpid/broker/Daemon.cpp
index 6fd1c3a292..a42f503708 100644
--- a/cpp/src/qpid/broker/Daemon.cpp
+++ b/cpp/src/qpid/broker/Daemon.cpp
@@ -41,10 +41,10 @@ void throwIf(bool condition, const string& msg, int errNo=errno) {
}
-/*--------------------------------------------------
- Rewritten using low-level IO, for compatibility
- with earlier Boost versions, i.e. 103200.
---------------------------------------------------*/
+/*
+ * Rewritten using low-level IO, for compatibility
+ * with earlier Boost versions, i.e. 103200.
+ */
struct LockFile {
LockFile(const std::string& path_, bool create)
@@ -86,10 +86,10 @@ string Daemon::pidFile(uint16_t port) {
return path.str();
}
-/*--------------------------------------------------
- Rewritten using low-level IO, for compatibility
- with earlier Boost versions, i.e. 103200.
---------------------------------------------------*/
+/*
+ * Rewritten using low-level IO, for compatibility
+ * with earlier Boost versions, i.e. 103200.
+ */
void Daemon::fork()
{
throwIf(::pipe(pipeFds) < 0, "Can't create pipe");
@@ -143,10 +143,10 @@ uint16_t Daemon::wait(int timeout) { // parent waits for child.
tv.tv_sec = timeout;
tv.tv_usec = 0;
- /*--------------------------------------------------
- Rewritten using low-level IO, for compatibility
- with earlier Boost versions, i.e. 103200.
- --------------------------------------------------*/
+ /*
+ * Rewritten using low-level IO, for compatibility
+ * with earlier Boost versions, i.e. 103200.
+ */
fd_set fds;
FD_ZERO(&fds);
FD_SET(pipeFds[0], &fds);
@@ -198,10 +198,10 @@ void Daemon::ready(uint16_t port) { // child
lockFile = pidFile(port);
LockFile lf(lockFile, true);
- /*---------------------------------------------------
- Rewritten using low-level IO, for compatibility
- with earlier Boost versions, i.e. 103200.
- ---------------------------------------------------*/
+ /*
+ * Rewritten using low-level IO, for compatibility
+ * with earlier Boost versions, i.e. 103200.
+ */
/*
* Write the PID to the lockfile.
*/
@@ -230,10 +230,11 @@ pid_t Daemon::getPid(uint16_t port) {
string name = pidFile(port);
LockFile lf(name, false);
pid_t pid;
- /*---------------------------------------------------
- Rewritten using low-level IO, for compatibility
- with earlier Boost versions, i.e. 103200.
- ---------------------------------------------------*/
+
+ /*
+ * Rewritten using low-level IO, for compatibility
+ * with earlier Boost versions, i.e. 103200.
+ */
int desired_read = sizeof(pid_t);
if ( desired_read > ::read(lf.fd, & pid, desired_read) ) {
throw Exception("Cannot read lock file " + name);