summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile4
-rw-r--r--src/faketime.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
index c1b890d..62e924c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -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
#
diff --git a/src/faketime.c b/src/faketime.c
index 5dd4c0a..d848509 100644
--- a/src/faketime.c
+++ b/src/faketime.c
@@ -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"))