aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryaworsky <yaworsky>2005-10-31 13:20:45 +0000
committeryaworsky <yaworsky>2005-10-31 13:20:45 +0000
commit10379ee810238a765bf94a4ba48e4fff04fc7b6f (patch)
tree85efda959420d67a5421ce318f9e566a7fe84ae4
parent2f3e30fc859007be7e781c89b59f56a3ce7f3566 (diff)
downloadsyslog-win32-10379ee810238a765bf94a4ba48e4fff04fc7b6f.tar.gz
syslog-win32-10379ee810238a765bf94a4ba48e4fff04fc7b6f.tar.xz
syslog-win32-10379ee810238a765bf94a4ba48e4fff04fc7b6f.zip
Clarified loop.
-rw-r--r--daemon/dest_file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/daemon/dest_file.c b/daemon/dest_file.c
index cbf1cc1..a1e917b 100644
--- a/daemon/dest_file.c
+++ b/daemon/dest_file.c
@@ -452,11 +452,15 @@ static void put_message_to_file_dest( struct destination* destination, struct me
EnterCriticalSection( &extra->cs_file_writers );
/* find existing writer */
for( writer = NULL, item = extra->file_writers; item; item = item->next )
- if( strcmp( ((struct file_writer*) (item->data))->file_name, file_name ) == 0 )
+ {
+ struct file_writer *w = item->data;
+
+ if( strcmp( w->file_name, file_name ) == 0 )
{
- writer = item->data;
+ writer = w;
break;
}
+ }
if( !writer )
{
/* create new writer */