From 9e238d624e8d41bb3da0f04f218cd33ecb5e9d58 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 5 Apr 2019 14:13:38 +0200 Subject: [PATCH] extract: discharge dependency from timer session This patch removes the reliance of the extract tool from the libc's behavior regarding the access of time and timing. The extract tool is not expected to need time. However, unfortunately, libarchive calls the 'time' function unconditionally. By adding a dummy for 'time', we avoid bothering the libc, which would otherwise need to obtain a time source. Issue #3204 --- repos/libports/run/extract.run | 2 +- repos/libports/src/app/extract/main.cc | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/repos/libports/run/extract.run b/repos/libports/run/extract.run index 4cd5812a39..c8da860165 100644 --- a/repos/libports/run/extract.run +++ b/repos/libports/run/extract.run @@ -18,7 +18,7 @@ install_config { - + diff --git a/repos/libports/src/app/extract/main.cc b/repos/libports/src/app/extract/main.cc index f2500fa74d..bfc01bcc0f 100644 --- a/repos/libports/src/app/extract/main.cc +++ b/repos/libports/src/app/extract/main.cc @@ -291,6 +291,20 @@ void Libc::Component::construct(Libc::Env &env) static Extract::Main main(env); } -/* dummy to prevent warning printed by unimplemented libc function */ +/** + * Dummy to prevent warning printed by unimplemented libc function + */ extern "C" mode_t umask(mode_t value) { return value; } +/** + * Dummy to discharge the dependency from a timer session + * + * When libarchive creates a archives, it requests the current time to create + * up-to-date time stamps. Unfortunately, however, 'time' is called + * unconditionally regardless of whether an archive is created or extracted. + * In the latter (our) case, the wall-clock time is not relevant. Still, + * libarchive creates an artificial dependency from a time source in either + * case. + */ +extern "C" time_t time(time_t *) { return 0; } +