From bfce470690d8d9dbb5bde03707777b8bd1c771e1 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 1 Oct 2024 15:15:36 +0200 Subject: [PATCH] app/usb_webcam: initialize libc environment Restores debugging with LIBUSB_DEBUG=. --- repos/libports/src/app/usb_webcam/main.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/repos/libports/src/app/usb_webcam/main.cc b/repos/libports/src/app/usb_webcam/main.cc index c5da5ae6c6..19e15050a2 100644 --- a/repos/libports/src/app/usb_webcam/main.cc +++ b/repos/libports/src/app/usb_webcam/main.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #pragma GCC diagnostic push @@ -295,7 +296,17 @@ class Main }; +extern char **environ; + void Libc::Component::construct(Libc::Env &env) { + int argc = 0; + char **argv = nullptr; + char **envp = nullptr; + + populate_args_and_env(env, argc, argv, envp); + + environ = envp; + static Main main(env); }