From ac674b84ecd124943073d4fb1a666920a7dda883 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Sat, 25 Apr 2026 21:59:57 +0000 Subject: [PATCH] src/utils.c: tee request_log() to /tmp/libva-fourier.log Sandboxed processes (Chromium GPU process etc.) redirect stderr, so request_log() output never reaches our test harness. Add a lazy-open append to /tmp/libva-fourier.log so we can capture diagnostic logging regardless of process sandboxing. Will revert before final. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/utils.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/utils.c b/src/utils.c index d37eeee..e5a4639 100644 --- a/src/utils.c +++ b/src/utils.c @@ -33,10 +33,24 @@ void request_log(const char *format, ...) { va_list arguments; + static FILE *trace_fp; fprintf(stderr, "%s: ", V4L2_REQUEST_STR_VENDOR); va_start(arguments, format); vfprintf(stderr, format, arguments); va_end(arguments); + + /* Fourier-local: also tee to /tmp/libva-fourier.log so messages are + * visible from sandboxed GPU processes (Chromium etc.) where stderr + * is redirected. Append-mode, lazy-open. */ + if (trace_fp == NULL) + trace_fp = fopen("/tmp/libva-fourier.log", "a"); + if (trace_fp != NULL) { + fprintf(trace_fp, "%s: ", V4L2_REQUEST_STR_VENDOR); + va_start(arguments, format); + vfprintf(trace_fp, format, arguments); + va_end(arguments); + fflush(trace_fp); + } }