From 30ff4d3ea1ed327f29e3ed921792bdd996779728 Mon Sep 17 00:00:00 2001
From: Simon Ruderich <simon@ruderich.org>
Date: Sat, 23 Jan 2016 17:46:43 +0100
Subject: [PATCH] run_in_background: fix execution when debug mode is enabled

---
 bin/fcscs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/fcscs b/bin/fcscs
index 054842a..0033af8 100755
--- a/bin/fcscs
+++ b/bin/fcscs
@@ -458,6 +458,9 @@ sub run_in_background {
         my $pid = fork;
         defined $pid or die $!;
         if ($pid == 0) { # child
+            # Disable debug mode as writing will fail with closed STDERR.
+            $config->{setting}{debug} = 0;
+
             $sub->();
         }
         exit;
-- 
2.49.0