summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpidd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src/qpidd.cpp')
-rw-r--r--qpid/cpp/src/qpidd.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpidd.cpp b/qpid/cpp/src/qpidd.cpp
index d5f570b458..ab4de50a2d 100644
--- a/qpid/cpp/src/qpidd.cpp
+++ b/qpid/cpp/src/qpidd.cpp
@@ -62,8 +62,16 @@ struct DaemonOptions : public qpid::Options {
int wait;
std::string piddir;
- DaemonOptions() : qpid::Options("Daemon options"), daemon(false), quit(false), check(false), wait(10), piddir("/tmp")
+ DaemonOptions() : qpid::Options("Daemon options"), daemon(false), quit(false), check(false), wait(10)
{
+ char *home = ::getenv("HOME");
+
+ if (home == 0)
+ home = "/tmp";
+
+ piddir += home;
+ piddir += "/.qpidd";
+
addOptions()
("daemon,d", optValue(daemon), "Run as a daemon.")
("pid-dir", optValue(piddir, "DIR"), "Directory where port-specific PID file is stored")