summaryrefslogtreecommitdiffstats
path: root/plugins/omstdout/omstdout.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-09-13 02:39:42 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-09-13 02:39:42 +0200
commit7903677bfba6fd897010d9c5dbb56531bfe0d825 (patch)
tree110e409834bab0fb1edd8f869e911c8d8d510493 /plugins/omstdout/omstdout.c
parentad777330629c31447018e47b4033a7ebaa9fe655 (diff)
parent15921d4e4e9d03e0cfd4ca5a9745c89b5dcd37c3 (diff)
downloadrsyslog-7903677bfba6fd897010d9c5dbb56531bfe0d825.tar.gz
rsyslog-7903677bfba6fd897010d9c5dbb56531bfe0d825.tar.bz2
rsyslog-7903677bfba6fd897010d9c5dbb56531bfe0d825.zip
Merge branch 'v7-stable' into v7-stable-tlsfix
Conflicts: ChangeLog runtime/rsyslog.h
Diffstat (limited to 'plugins/omstdout/omstdout.c')
-rw-r--r--plugins/omstdout/omstdout.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/omstdout/omstdout.c b/plugins/omstdout/omstdout.c
index 59f9c8bb..a84a7593 100644
--- a/plugins/omstdout/omstdout.c
+++ b/plugins/omstdout/omstdout.c
@@ -105,6 +105,7 @@ BEGINdoAction
int iBuf;
char szBuf[65564];
size_t len;
+ int r;
CODESTARTdoAction
if(pData->bUseArrayInterface) {
/* if we use array passing, we need to put together a string
@@ -140,9 +141,15 @@ CODESTARTdoAction
* actually intends to use this module in production (why???), this code
* needs to be more solid. -- rgerhards, 2012-11-28
*/
- if(write(1, toWrite, len)) {}; /* 1 is stdout! */
+ if((r = write(1, toWrite, len)) != (int) len) { /* 1 is stdout! */
+ DBGPRINTF("omstdout: error %d writing to stdout[%d]: %s\n",
+ r, len, toWrite);
+ }
if(pData->bEnsureLFEnding && toWrite[len-1] != '\n') {
- if(write(1, "\n", 1)) {}; /* write missing LF */
+ if((r = write(1, "\n", 1)) != 1) { /* write missing LF */
+ DBGPRINTF("omstdout: error %d writing \\n to stdout\n",
+ r);
+ }
}
ENDdoAction