From 65ea3f2a461c0eeca7d14c4258eea52e19f0ed06 Mon Sep 17 00:00:00 2001 From: Aliaksei Karaliou Date: Thu, 27 Dec 2018 04:18:28 -0500 Subject: [PATCH] s3:util: Move popen wrappers to lib/util When linked into Samba3 libraries, sys_popen()/sys_pclose() cannot be used in lower level libraries because of circular dependencies. This patch moves them into common samba-util library. Signed-off-by: Aliaksei Karaliou Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- {source3/lib => lib/util}/sys_popen.c | 2 +- {source3/lib => lib/util}/sys_popen.h | 0 lib/util/wscript_build | 4 ++-- source3/lib/util_file.c | 2 +- source3/wscript_build | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) rename {source3/lib => lib/util}/sys_popen.c (99%) rename {source3/lib => lib/util}/sys_popen.h (100%) diff --git a/source3/lib/sys_popen.c b/lib/util/sys_popen.c similarity index 99% rename from source3/lib/sys_popen.c rename to lib/util/sys_popen.c index 607e599cf3f..709f1822f33 100644 --- a/source3/lib/sys_popen.c +++ b/lib/util/sys_popen.c @@ -21,7 +21,7 @@ #include "system/wait.h" #include "system/filesys.h" #include -#include "lib/sys_popen.h" +#include "lib/util/sys_popen.h" #include "lib/util/debug.h" /************************************************************************** diff --git a/source3/lib/sys_popen.h b/lib/util/sys_popen.h similarity index 100% rename from source3/lib/sys_popen.h rename to lib/util/sys_popen.h diff --git a/lib/util/wscript_build b/lib/util/wscript_build index 883c1dd5b29..64778b3e4c3 100644 --- a/lib/util/wscript_build +++ b/lib/util/wscript_build @@ -68,14 +68,14 @@ bld.SAMBA_LIBRARY('talloc_report', ) bld.SAMBA_SUBSYSTEM('samba-util-core', - source='''data_blob.c util_file.c time.c + source='''data_blob.c util_file.c sys_popen.c time.c signal.c util.c idtree.c fault.c substitute.c util_process.c util_strlist.c strv_util.c bitmap.c select.c pidfile.c become_daemon.c mkdir_p.c''', deps='''time-basic samba-debug socket-blocking talloc tevent execinfo pthread strv tini''', - public_deps='systemd systemd-daemon', + public_deps='systemd systemd-daemon sys_rw', local_include=False) bld.SAMBA_LIBRARY('iov_buf', diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index d3139e55b57..94e1118225f 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -22,7 +22,7 @@ #include "lib/util/debug.h" #include "lib/util/samba_util.h" #include "lib/util/sys_rw.h" -#include "lib/sys_popen.h" +#include "lib/util/sys_popen.h" #include "lib/async_req/async_sock.h" #include "lib/util/tevent_unix.h" diff --git a/source3/wscript_build b/source3/wscript_build index f25a27ba3a8..11c877818c2 100644 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -302,7 +302,6 @@ bld.SAMBA3_SUBSYSTEM('samba3util', lib/util_sock.c lib/util_tsock.c lib/util_transfer_file.c - lib/sys_popen.c ''', deps=''' CHARSET3