From e56e5dcaa6eea4d43e7c87d29ec3b8cbf1187a29 Mon Sep 17 00:00:00 2001 From: c vw Date: Fri, 14 Aug 2020 10:43:18 +0200 Subject: [PATCH] Re-direct stdout and stderr to current work dir files --- MacOS.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MacOS.c b/MacOS.c index 55e4176..ec095ae 100644 --- a/MacOS.c +++ b/MacOS.c @@ -94,10 +94,16 @@ void MacOSstartup(char *path) { // chdir to the work dir // chdir(workdir); - c=getcwd(workdir,sizeof(workdir)); +// +// Make two local files for stdout and stderr, to allow +// post-mortem debugging +// + (void) freopen("pihpsdr.stdout", "w", stdout); + (void) freopen("pihpsdr.stderr", "w", stderr); // // Copy icon from app bundle to the work dir // + c=getcwd(workdir,sizeof(workdir)); if (strlen(path) < 1024) { // // source = basename of the executable -- 2.45.2