faketime wrapper complains when env vars are set unless comp/w SILENT (closes #307)

This commit is contained in:
Wolfgang Hommel
2022-02-20 20:40:19 +01:00
parent 02bc1fccae
commit 9dcaf53fd7
2 changed files with 10 additions and 0 deletions

View File

@@ -80,6 +80,10 @@
# ld automatically choose the correct library version to use for the
# target binary. Use for Linux platforms with Multi-Arch support only!
#
# SILENT
# - avoid that the faketime wrapper complains when running within a
# libfaketime environment
#
# * Compilation addition: second libMT target added for building the pthread-
# enabled library as a separate library
#

View File

@@ -114,6 +114,12 @@ int main (int argc, char **argv)
bool fake_pid = false;
const char *pid_val;
#ifndef SILENT
if (getenv("FAKETIME") || getenv("FAKETIME_SHARED") || getenv("FAKETIME_FAKEPID") || getenv("FAKERANDOM_SEED")) {
fprintf(stderr, "faketime: You appear to be running faketime within a libfaketime environment. Proceeding, but check for unexpected results...\n");
}
#endif
while (curr_opt < argc)
{
if (0 == strcmp(argv[curr_opt], "-m"))