summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-24 17:55:09 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-24 17:55:09 +0000
commit5c686c8adcc473cbdbb14e4b2d736f9123210ee6 (patch)
treeeb83fbca0d98ac4948b6d9ca22d8a0e4828815a9 /stream.c
parent76782c240db52c81825c907c40c31ca8b48218de (diff)
downloadrsyslog-5c686c8adcc473cbdbb14e4b2d736f9123210ee6.tar.gz
rsyslog-5c686c8adcc473cbdbb14e4b2d736f9123210ee6.tar.xz
rsyslog-5c686c8adcc473cbdbb14e4b2d736f9123210ee6.zip
redesigned queue to utilize helper classes for threading support. This is
finally in a running state for regular (non disk-assisted) queues, with a minor nit at shutdown. So I can finally commit the work again to CVS...
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/stream.c b/stream.c
index 15d9dcf6..cb6d5e29 100644
--- a/stream.c
+++ b/stream.c
@@ -107,7 +107,7 @@ static rsRetVal strmOpenFile(strm_t *pThis)
iFlags, pThis->fd);
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -138,7 +138,7 @@ static rsRetVal strmCloseFile(strm_t *pThis)
pThis->pszCurrFName = NULL;
}
- return iRet;
+ RETiRet;
}
@@ -165,7 +165,7 @@ strmNextFile(strm_t *pThis)
pThis->iCurrFNum = (pThis->iCurrFNum + 1) % pThis->iMaxFiles;
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -228,7 +228,7 @@ rsRetVal strmReadChar(strm_t *pThis, uchar *pC)
//dbgprintf("ReadChar: read %c, offset %d\n", *pC, pThis->iCurrOffs);
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -285,7 +285,7 @@ finalize_it:
if(iRet != RS_RET_OK && pCStr != NULL)
rsCStrDestruct(pCStr);
- return iRet;
+ RETiRet;
}
#endif /* #if 0 - saved code */
@@ -293,13 +293,13 @@ finalize_it:
/* Standard-Constructor for the strm object
*/
-BEGINobjConstruct(strm)
+BEGINobjConstruct(strm) /* be sure to specify the object type also in END macro! */
pThis->iCurrFNum = 1;
pThis->fd = -1;
pThis->iUngetC = -1;
pThis->sType = STREAMTYPE_FILE_SINGLE;
pThis->sIOBufSize = glblGetIOBufSize();
- pThis->tOpenMode = 0600;
+ pThis->tOpenMode = 0600; /* TODO: make configurable */
ENDobjConstruct(strm)
@@ -319,7 +319,7 @@ rsRetVal strmConstructFinalize(strm_t *pThis)
}
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -347,7 +347,7 @@ rsRetVal strmDestruct(strm_t **ppThis)
free(pThis);
*ppThis = NULL;
- return iRet;
+ RETiRet;
}
@@ -370,7 +370,7 @@ static rsRetVal strmCheckNextOutputFile(strm_t *pThis)
}
finalize_it:
- return iRet;
+ RETiRet;
}
/* write memory buffer to a stream object.
@@ -413,7 +413,7 @@ static rsRetVal strmWriteInternal(strm_t *pThis, uchar *pBuf, size_t lenBuf)
finalize_it:
pThis->iBufPtr = 0; /* see comment above */
- return iRet;
+ RETiRet;
}
@@ -432,7 +432,7 @@ rsRetVal strmFlush(strm_t *pThis)
iRet = strmWriteInternal(pThis, pThis->pIOBuf, pThis->iBufPtr);
}
- return iRet;
+ RETiRet;
}
@@ -457,7 +457,7 @@ dbgprintf("seek(%d, %ld): %d\n", pThis->fd, offs, i);
pThis->iCurrOffs = offs; /* we are now at *this* offset */
pThis->iBufPtr = 0; /* buffer invalidated */
- return iRet;
+ RETiRet;
}
@@ -471,7 +471,7 @@ rsRetVal strmSeekCurrOffs(strm_t *pThis)
ISOBJ_TYPE_assert(pThis, strm);
iRet = strmSeek(pThis, pThis->iCurrOffs);
- return iRet;
+ RETiRet;
}
@@ -492,7 +492,7 @@ rsRetVal strmWriteChar(strm_t *pThis, uchar c)
pThis->iBufPtr++;
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -508,7 +508,7 @@ rsRetVal strmWriteLong(strm_t *pThis, long i)
CHKiRet(strmWrite(pThis, szBuf, strlen((char*)szBuf)));
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -551,7 +551,7 @@ rsRetVal strmWrite(strm_t *pThis, uchar *pBuf, size_t lenBuf)
}
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -581,7 +581,7 @@ rsRetVal strmSetiAddtlOpenFlags(strm_t *pThis, int iNewVal)
pThis->iAddtlOpenFlags = iNewVal;
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -608,7 +608,7 @@ strmSetFName(strm_t *pThis, uchar *pszName, size_t iLenName)
pThis->lenFName = iLenName;
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -635,7 +635,7 @@ strmSetDir(strm_t *pThis, uchar *pszDir, size_t iLenDir)
pThis->lenDir = iLenDir;
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -678,7 +678,7 @@ rsRetVal strmRecordEnd(strm_t *pThis)
pThis->bInRecord = 0;
iRet = strmCheckNextOutputFile(pThis); /* check if we need to switch files */
- return iRet;
+ RETiRet;
}
/* end stream record support functions */
@@ -723,7 +723,7 @@ rsRetVal strmSerialize(strm_t *pThis, strm_t *pStrm)
CHKiRet(objEndSerialize(pStrm));
finalize_it:
- return iRet;
+ RETiRet;
}
@@ -763,7 +763,7 @@ rsRetVal strmSetProperty(strm_t *pThis, property_t *pProp)
}
finalize_it:
- return iRet;
+ RETiRet;
}
#undef isProp