]> xenbits.xensource.com Git - xen.git/commitdiff
oxenstored: honour XEN_RUN_STORED in systemd C stub
authorWei Liu <wei.liu2@citrix.com>
Mon, 13 Jun 2016 07:49:15 +0000 (08:49 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 17 Jun 2016 10:27:21 +0000 (11:27 +0100)
Generate a _paths.h for that and add proper dependency.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
.gitignore
tools/ocaml/xenstored/Makefile
tools/ocaml/xenstored/systemd_stubs.c

index 5914bbe7fe3dca660aefcba8bc6a0377a701eee9..e019f2ed0e2b9a9cbf21e84ac4c847444af9a7c3 100644 (file)
@@ -349,6 +349,7 @@ tools/ocaml/libs/xentoollog/_xtl_levels.*
 tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/libs/xs/paths.ml
+tools/ocaml/xenstored/_paths.h
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/xenstored/oxenstored.conf
 tools/ocaml/xenstored/paths.ml
index 939dcaa987435f38557e8f24a6cd9fc0970060d4..1769e55810dad0e5c1ee401db1da95b6f7368609 100644 (file)
@@ -30,6 +30,8 @@ systemd_OBJS = systemd
 systemd_C_OBJS = systemd_stubs
 OCAML_LIBRARY += systemd
 
+$(foreach obj,$(systemd_C_OBJS),$(obj).o): _paths.h
+
 LIBS_systemd += $(LDFLAGS-y)
 
 OBJS = paths \
@@ -93,3 +95,8 @@ genpath-target = $(call buildmakevars2module,paths.ml)
 $(eval $(genpath-target))
 
 GENERATED_FILES += paths.ml
+
+genpath-target = $(call buildmakevars2header,_paths.h)
+$(eval $(genpath-target))
+
+GENERATE_FILES += _paths.h
index a78a72b75c2c0427ef44baa33405bd6cb41d4c19..322f1e012ec1dd374fb8560e59217212cc22aad4 100644 (file)
@@ -28,6 +28,8 @@
 #include <sys/socket.h>
 #include <systemd/sd-daemon.h>
 
+#include "_paths.h"
+
 /* Will work regardless of the order systemd gives them to us */
 static int oxen_get_sd_fd(const char *connect_to)
 {
@@ -46,8 +48,8 @@ static int oxen_get_sd_fd(const char *connect_to)
 
 static int oxen_verify_socket_socket(const char *connect_to)
 {
-       if ((strcmp("/var/run/xenstored/socket_ro", connect_to) != 0) &&
-           (strcmp("/var/run/xenstored/socket", connect_to) != 0)) {
+       if ((strcmp(XEN_RUN_STORED "/socket_ro", connect_to) != 0) &&
+           (strcmp(XEN_RUN_STORED "/socket", connect_to) != 0)) {
                sd_notifyf(0, "STATUS=unexpected socket: %s\n"
                           "ERRNO=%i",
                           connect_to,