summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/CommLayer/CommLayerServerSocket.cpp6
-rw-r--r--lib/CommLayer/CommLayerServerSocket.h2
-rw-r--r--lib/CommLayer/Makefile.am3
-rw-r--r--src/CLI/CLI.cpp4
-rw-r--r--src/CLI/Makefile.am2
5 files changed, 9 insertions, 8 deletions
diff --git a/lib/CommLayer/CommLayerServerSocket.cpp b/lib/CommLayer/CommLayerServerSocket.cpp
index 38571942..dd00489d 100644
--- a/lib/CommLayer/CommLayerServerSocket.cpp
+++ b/lib/CommLayer/CommLayerServerSocket.cpp
@@ -170,14 +170,14 @@ CCommLayerServerSocket::CCommLayerServerSocket()
int len;
struct sockaddr_un local;
- unlink(SOCKET_PATH);
+ unlink(SOCKET_FILE);
if ((m_nSocket = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
{
throw CABRTException(EXCEP_FATAL, "CCommLayerServerSocket::CCommLayerServerSocket(): Can not create socket.");
}
fcntl(m_nSocket, F_SETFD, FD_CLOEXEC);
local.sun_family = AF_UNIX;
- strcpy(local.sun_path, SOCKET_PATH);
+ strcpy(local.sun_path, SOCKET_FILE);
len = strlen(local.sun_path) + sizeof(local.sun_family);
if (bind(m_nSocket, (struct sockaddr *)&local, len) == -1)
{
@@ -187,7 +187,7 @@ CCommLayerServerSocket::CCommLayerServerSocket()
{
throw CABRTException(EXCEP_FATAL, "CCommLayerServerSocket::CCommLayerServerSocket(): Can not listen on the socket.");
}
- chmod(SOCKET_PATH, SOCKET_PERMISSION);
+ chmod(SOCKET_FILE, SOCKET_PERMISSION);
m_pGSocket = g_io_channel_unix_new(m_nSocket);
if (!g_io_add_watch(m_pGSocket,
diff --git a/lib/CommLayer/CommLayerServerSocket.h b/lib/CommLayer/CommLayerServerSocket.h
index 9e165c70..409780fc 100644
--- a/lib/CommLayer/CommLayerServerSocket.h
+++ b/lib/CommLayer/CommLayerServerSocket.h
@@ -1,7 +1,7 @@
#include "CommLayerServer.h"
#include <glib.h>
-#define SOCKET_PATH "/tmp/abrt.socket"
+#define SOCKET_FILE VAR_RUN"/abrt.socket"
#define SOCKET_PERMISSION 0666
class CCommLayerServerSocket : public CCommLayerServer
diff --git a/lib/CommLayer/Makefile.am b/lib/CommLayer/Makefile.am
index 3f10888d..96f897b9 100644
--- a/lib/CommLayer/Makefile.am
+++ b/lib/CommLayer/Makefile.am
@@ -12,7 +12,8 @@ libABRTCommLayer_la_CPPFLAGS = -Wall -Werror -I$(srcdir)/../../lib/MiddleWare\
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(GLIB_CFLAGS) $(DBUSCPP_CFLAGS) \
-DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \
-DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \
- -DCONF_DIR=\"$(CONF_DIR)\" -D_GNU_SOURCE
+ -DCONF_DIR=\"$(CONF_DIR)\" -D_GNU_SOURCE \
+ -DVAR_RUN=\"$(VAR_RUN)\"
#check_PROGRAMS = test
#test_SOURCES = test.cpp
diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp
index 0700ebf3..d711c7d7 100644
--- a/src/CLI/CLI.cpp
+++ b/src/CLI/CLI.cpp
@@ -4,7 +4,7 @@
#include <string.h>
-#define SOCKET_PATH "/tmp/abrt.socket"
+#define SOCKET_FILE VAR_RUN"/abrt.socket"
typedef enum {HELP,
GET_LIST,
@@ -131,7 +131,7 @@ int main(int argc, char** argv)
try
{
- ABRTSocket.Connect(SOCKET_PATH);
+ ABRTSocket.Connect(SOCKET_FILE);
switch (param.m_Mode)
{
diff --git a/src/CLI/Makefile.am b/src/CLI/Makefile.am
index 78c3803f..08779c90 100644
--- a/src/CLI/Makefile.am
+++ b/src/CLI/Makefile.am
@@ -1,3 +1,3 @@
bin_PROGRAMS = abrt-cli
abrt_cli_SOURCES = ABRTSocket.cpp ABRTSocket.h CLI.cpp
-abrt_cli_CPPFLAGS = -I$(srcdir)/../../inc \ No newline at end of file
+abrt_cli_CPPFLAGS = -I$(srcdir)/../../inc -DVAR_RUN=\"$(VAR_RUN)\" \ No newline at end of file