Skip to content

Commit 41491a3

Browse files
committed
Merge pull request #20 from cgwalters/centos7-build-fixes
Build on CentOS7 (Project Atomic C7 Continuous rdgo)
2 parents 0fa3a9b + 387092e commit 41491a3

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.dir-locals.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
((c-mode . ((indent-tabs-mode . t) (c-file-style . "linux"))))

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
libexec_PROGRAMS = oci-systemd-hook
22
oci_systemd_hook_SOURCES= src/systemdhook.c
33

4-
oci_systemd_hook_CFLAGS = $(YAJL_CFLAGS)
4+
oci_systemd_hook_CFLAGS = -std=c99 $(YAJL_CFLAGS)
55
oci_systemd_hook_LDADD = $(YAJL_LIBS)
66
oci_systemd_hook_CFLAGS += $(SELINUX_CFLAGS)
77
oci_systemd_hook_LDADD += $(SELINUX_LIBS)

configure.ac

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ AC_CONFIG_AUX_DIR([build-aux])
33
AC_CONFIG_HEADERS([config.h])
44
AM_INIT_AUTOMAKE([foreign -Wall -Werror subdir-objects])
55
AC_PROG_CC
6+
AM_PROG_CC_C_O
7+
AC_USE_SYSTEM_EXTENSIONS
8+
AC_SYS_LARGEFILE
69

710
PKG_CHECK_MODULES([YAJL], [yajl >= 2.0.0])
811
PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0.0])
9-
PKG_CHECK_MODULES([LIBMOUNT], [mount >= 2.27.0])
12+
PKG_CHECK_MODULES([LIBMOUNT], [mount >= 2.23.0])
1013

1114
AC_MSG_CHECKING([whether to disable argument checking])
1215
AC_ARG_ENABLE([args], AS_HELP_STRING([--disable-args], [disable checking that cmd args are either init/systemd]))

src/systemdhook.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ static char *get_process_cgroup_subsystem_path(int pid, const char *subsystem) {
232232
ssize_t read;
233233
size_t len = 0;
234234
char *ptr;
235-
char *path;
236235
char *subsystem_path = NULL;
237236
while ((read = getline(&line, &len, fp)) != -1) {
238237
pr_pdebug("%s", line);
@@ -411,7 +410,7 @@ static int prestart(const char *rootfs,
411410
}
412411

413412
if (strcmp("", mount_label)) {
414-
rc = setfilecon(journal_dir, mount_label);
413+
rc = setfilecon(journal_dir, (security_context_t)mount_label);
415414
if (rc < 0) {
416415
pr_perror("Failed to set journal dir selinux context");
417416
return -1;
@@ -508,7 +507,6 @@ int main(int argc, char *argv[])
508507
char errbuf[BUFLEN];
509508
char stateData[CONFIGSZ];
510509
char configData[CONFIGSZ];
511-
int ret = -1;
512510
_cleanup_fclose_ FILE *fp = NULL;
513511

514512
stateData[0] = 0;

0 commit comments

Comments
 (0)