Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to libglib, use it in one place to start #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ oci_umount_optionsdir=/usr/share/oci-umount/

oci_umount_CFLAGS = -Wall -Wextra -std=c99 $(YAJL_CFLAGS)
oci_umount_LDADD = $(YAJL_LIBS)
oci_umount_CFLAGS += $(SELINUX_CFLAGS)
oci_umount_LDADD += $(SELINUX_LIBS)
oci_umount_CFLAGS += $(SELINUX_CFLAGS) $(GLIB_CFLAGS)
oci_umount_LDADD += $(SELINUX_LIBS) $(GLIB_LIBS)

dist_man_MANS = oci-umount.1
EXTRA_DIST = README.md LICENSE
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ AM_PROG_CC_C_O
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE

PKG_CHECK_MODULES([GLIB], [gio-unix-2.0 >= 2.50])
PKG_CHECK_MODULES([YAJL], [yajl >= 2.0.0])
PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0.0])
PKG_CHECK_MODULES([LIBMOUNT], [mount >= 2.23.0])
Expand Down
7 changes: 2 additions & 5 deletions src/oci-umount.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define _GNU_SOURCE
#include <glib.h>
#include <stdio.h>
#include <libgen.h>
#include <stdlib.h>
Expand Down Expand Up @@ -363,11 +364,7 @@ static int map_mount_host_to_container(const char *id, const struct config_mount
int ret;
unsigned nr_mapped = 0;

host_mnt_dup = strdup(host_mnt);
if (!host_mnt_dup) {
pr_perror("%s: strdup(%s) failed.", id, host_mnt);
return -1;
}
host_mnt_dup = g_strdup(host_mnt);

str = host_mnt_dup;
do {
Expand Down