summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbootstrap-configure1
-rw-r--r--src/Makefile.am4
-rw-r--r--src/main.c7
3 files changed, 11 insertions, 1 deletions
diff --git a/bootstrap-configure b/bootstrap-configure
index 2d56ff31..1da77dae 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -8,4 +8,5 @@ fi
./configure --enable-maintainer-mode \
--prefix=/usr \
--mandir=/usr/share/man \
+ --localstatedir=/var \
--sysconfdir=/etc
diff --git a/src/Makefile.am b/src/Makefile.am
index 05f342b9..d693035f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,6 +9,8 @@ connmand_SOURCES = main.c connman.h plugin.c iface.c dhcp.c
connmand_LDADD = @HAL_LIBS@ @GDBUS_LIBS@ @GMODULE_LIBS@
+statedir = $(localstatedir)/run/connman
+
if MAINTAINER_MODE
plugindir = $(abs_top_srcdir)/plugins
else
@@ -16,7 +18,7 @@ plugindir = $(libdir)/connman/plugins
endif
AM_CFLAGS = @GMODULE_CFLAGS@ @GDBUS_CFLAGS@ @HAL_CFLAGS@ \
- -DPLUGINDIR=\""$(plugindir)"\"
+ -DSTATEDIR=\""$(statedir)"\" -DPLUGINDIR=\""$(plugindir)"\"
INCLUDES = -I$(top_builddir)/include
diff --git a/src/main.c b/src/main.c
index 89c49fdb..245dece0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -25,8 +25,10 @@
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include <string.h>
#include <signal.h>
+#include <sys/stat.h>
#include <gdbus.h>
@@ -44,6 +46,9 @@ int main(int argc, char *argv[])
DBusConnection *conn;
struct sigaction sa;
+ mkdir(STATEDIR, S_IRUSR | S_IWUSR | S_IXUSR |
+ S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+
main_loop = g_main_loop_new(NULL, FALSE);
conn = g_dbus_setup_bus(DBUS_BUS_SYSTEM, CONNMAN_SERVICE);
@@ -75,5 +80,7 @@ int main(int argc, char *argv[])
g_main_loop_unref(main_loop);
+ rmdir(STATEDIR);
+
return 0;
}