summaryrefslogtreecommitdiffstats
path: root/runtime/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/debug.c')
-rw-r--r--runtime/debug.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index 307a8bb8..26da31b4 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -902,8 +902,12 @@ do_dbgprint(uchar *pszObjName, char *pszMsg, size_t lenMsg)
lenCopy = lenMsg;
memcpy(pszWriteBuf + offsWriteBuf, pszMsg, lenCopy);
offsWriteBuf += lenCopy;
- if(stddbg != -1) write(stddbg, pszWriteBuf, offsWriteBuf);
- if(altdbg != -1) write(altdbg, pszWriteBuf, offsWriteBuf);
+ /* the write is included in an "if" just to silence compiler
+ * warnings. Here, we really don't care if the write fails, we
+ * have no good response to that in any case... -- rgerhards, 2012-11-28
+ */
+ if(stddbg != -1) if(write(stddbg, pszWriteBuf, offsWriteBuf)){};
+ if(altdbg != -1) if(write(altdbg, pszWriteBuf, offsWriteBuf)){};
bWasNL = (pszMsg[lenMsg - 1] == '\n') ? 1 : 0;
}
@@ -1292,6 +1296,15 @@ dbgmalloc(size_t size)
}
+/* report fd used for debug log. This is needed in case of
+ * auto-backgrounding, where the debug log shall not be closed.
+ */
+int
+dbgGetDbglogFd(void)
+{
+ return altdbg;
+}
+
/* read in the runtime options
* rgerhards, 2008-02-28
*/