Skip to content

Commit de4be15

Browse files
committed
sd-daemon.c: fix a compilation error
A following compilation error was observed: | libsystemd/sd-daemon.c:64: undefined reference to `strlcpy' fix it by include the required libite dependency. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
1 parent a73e02a commit de4be15

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

libsystemd/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
lib_LTLIBRARIES = libsystemd.la
33
libsystemd_la_SOURCES = sd-daemon.c sd-daemon.h
44
libsystemd_la_LDFLAGS = -version-info 0:0:0
5+
libsystemd_la_CFLAGS = $(lite_CFLAGS)
6+
libsystemd_la_LIBADD = $(lite_LIBS)
57

68
# pkg-config support
79
pkgconfigdir = $(libdir)/pkgconfig
810
pkgconfig_DATA = libsystemd.pc
911

1012
# Install header to systemd/ subdirectory
1113
systemddir = $(includedir)/systemd
12-
systemd_HEADERS = sd-daemon.h
14+
systemd_HEADERS = sd-daemon.h

libsystemd/sd-daemon.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
#include <sys/un.h>
2424
#include <time.h>
2525
#include <unistd.h>
26+
#ifdef _LIBITE_LITE
27+
# include <libite/lite.h>
28+
#else
29+
# include <lite/lite.h>
30+
#endif
2631

2732
#include "sd-daemon.h"
2833

test/src/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ noinst_PROGRAMS = serv
33
serv_SOURCES = serv.c
44
serv_CPPFLAGS = -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE -I$(top_builddir)
55
if LIBSYSTEMD
6-
serv_CPPFLAGS += -I$(top_srcdir)/libsystemd
6+
serv_CPPFLAGS += -I$(top_srcdir)/libsystemd $(lite_CFLAGS)
77
serv_SOURCES += $(top_srcdir)/libsystemd/sd-daemon.c
8+
serv_LDADD = $(lite_LIBS)
89
endif

0 commit comments

Comments
 (0)