- vsnprintf(buf, sizeof(buf), msg, args);
+ int n = vsnprintf(buf, sizeof(buf), msg, args);
+
+ if (write_errors_to_fd)
+ {
+ // We are inside the box, have to use error pipe for error reporting.
+ // We hope that the whole error message fits in PIPE_BUF bytes.
+ write(write_errors_to_fd, buf, n);
+ exit(2);
+ }
+
+ // Otherwise, we in the box keeper process, so we report errors normally
+ flush_line();