summaryrefslogtreecommitdiffstats
path: root/lib/CommLayer
diff options
context:
space:
mode:
authorZdenek Prikryl <zprikryl@redhat.com>2009-06-17 16:22:25 +0200
committerZdenek Prikryl <zprikryl@redhat.com>2009-06-17 16:22:25 +0200
commitf31ebd2e0aafc9404c95b8fe92a02d58216f918d (patch)
tree863bcec0713704b8aeb567e0e461e61816fe023e /lib/CommLayer
parent121e36536d05b32af17af3d513ffc96548d84381 (diff)
downloadabrt-f31ebd2e0aafc9404c95b8fe92a02d58216f918d.tar.gz
abrt-f31ebd2e0aafc9404c95b8fe92a02d58216f918d.tar.xz
abrt-f31ebd2e0aafc9404c95b8fe92a02d58216f918d.zip
new default socket path
Diffstat (limited to 'lib/CommLayer')
-rw-r--r--lib/CommLayer/CommLayerServerSocket.cpp6
-rw-r--r--lib/CommLayer/CommLayerServerSocket.h2
-rw-r--r--lib/CommLayer/Makefile.am3
3 files changed, 6 insertions, 5 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