summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-12-15 18:24:02 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-12-15 18:24:02 +0000
commitfaf8a3a3a9f2355ec7044144d63ef869788eebb3 (patch)
treef8f1d22ceb1a04d44f2353fcc352fdeafeafbbad /cpp/src/qpid/broker
parenta66973a94f41bc034d98d39028e13cbbff805b93 (diff)
downloadqpid-python-faf8a3a3a9f2355ec7044144d63ef869788eebb3.tar.gz
QPID-1951: Removed need for Windows versions of ssize_t and pid_t
- Trivially removed Windows uses of ssize_t - Rearchitected how the Windows port finds an existing qpidd to stop it - Split Posix Lockfile functionality using pids into a new PidFile class git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@890929 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker')
-rw-r--r--cpp/src/qpid/broker/Daemon.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/Daemon.cpp b/cpp/src/qpid/broker/Daemon.cpp
index e1d400e01b..b30e5f18cb 100644
--- a/cpp/src/qpid/broker/Daemon.cpp
+++ b/cpp/src/qpid/broker/Daemon.cpp
@@ -15,10 +15,16 @@
* limitations under the License.
*
*/
+
+/*
+ * TODO: Note this is really a Posix specific implementation and so should be
+ * refactored together with windows/QpiddBroker into a more coherent daemon driver/
+ * platform specific split
+ */
#include "qpid/broker/Daemon.h"
#include "qpid/log/Statement.h"
#include "qpid/Exception.h"
-#include "qpid/sys/LockFile.h"
+#include "qpid/sys/posix/PidFile.h"
#include <errno.h>
#include <fcntl.h>
@@ -31,7 +37,7 @@ namespace qpid {
namespace broker {
using namespace std;
-using qpid::sys::LockFile;
+using qpid::sys::PidFile;
Daemon::Daemon(std::string _pidDir) : pidDir(_pidDir) {
struct stat s;
@@ -176,7 +182,7 @@ uint16_t Daemon::wait(int timeout) { // parent waits for child.
*/
void Daemon::ready(uint16_t port) { // child
lockFile = pidFile(pidDir, port);
- LockFile lf(lockFile, true);
+ PidFile lf(lockFile, true);
/*
* Write the PID to the lockfile.
@@ -200,7 +206,7 @@ void Daemon::ready(uint16_t port) { // child
*/
pid_t Daemon::getPid(string _pidDir, uint16_t port) {
string name = pidFile(_pidDir, port);
- LockFile lf(name, false);
+ PidFile lf(name, false);
pid_t pid = lf.readPid();
if (kill(pid, 0) < 0 && errno != EPERM) {
unlink(name.c_str());