diff options
author | yaworsky <yaworsky> | 2005-11-18 09:45:14 +0000 |
---|---|---|
committer | yaworsky <yaworsky> | 2005-11-18 09:45:14 +0000 |
commit | a71d55cedfa6b226582195add906116a4d5648f7 (patch) | |
tree | 51c11bf99864fa3882a03c44cf579ed5183a9f8e | |
parent | 049555ae5eb7c778e80f7b090530f2580aa84f3d (diff) | |
download | syslog-win32-a71d55cedfa6b226582195add906116a4d5648f7.tar.gz syslog-win32-a71d55cedfa6b226582195add906116a4d5648f7.tar.xz syslog-win32-a71d55cedfa6b226582195add906116a4d5648f7.zip |
Use the right comparsion function and rename string_compare to string_equal
Diffstat (limited to '')
-rw-r--r-- | daemon/dest_file.c | 20 | ||||
-rwxr-xr-x | daemon/string.c | 6 | ||||
-rw-r--r-- | daemon/syslogd.h | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/daemon/dest_file.c b/daemon/dest_file.c index 7ede68c..c4d3cfe 100644 --- a/daemon/dest_file.c +++ b/daemon/dest_file.c @@ -67,19 +67,19 @@ static gboolean compare_current_and_first_messages( struct file_writer* writer ) { TRACE_ENTER( "%p\n", writer ); - if( string_compare( writer->current_msg->hostname, - writer->first_msg->hostname ) - || string_compare( writer->current_msg->message, - writer->first_msg->message ) ) + if( string_equal( writer->current_msg->hostname, + writer->first_msg->hostname ) + && string_equal( writer->current_msg->message, + writer->first_msg->message ) ) { - release_message( writer->first_msg ); - writer->first_msg = NULL; - TRACE_LEAVE( "%p done; messages aren't identical\n", writer ); - return FALSE; + TRACE_LEAVE( "%p ok\n" ); + return TRUE; } - TRACE_LEAVE( "%p ok\n" ); - return TRUE; + release_message( writer->first_msg ); + writer->first_msg = NULL; + TRACE_LEAVE( "%p done; messages aren't identical\n", writer ); + return FALSE; } /****************************************************************************** diff --git a/daemon/string.c b/daemon/string.c index 6684664..5dd6a45 100755 --- a/daemon/string.c +++ b/daemon/string.c @@ -108,9 +108,9 @@ struct string* string_printf( gchar* fmt, ... ) return s; } -int string_compare( struct string* s1, struct string* s2 ) +gboolean string_equal( struct string* s1, struct string* s2 ) { if( s1 == s2 ) - return 0; - return strcmp( s1->gstr->str, s2->gstr->str ); + return TRUE; + return g_string_equal( s1->gstr, s2->gstr ); } diff --git a/daemon/syslogd.h b/daemon/syslogd.h index c48f8f8..a70b326 100644 --- a/daemon/syslogd.h +++ b/daemon/syslogd.h @@ -48,7 +48,7 @@ extern void string_release( struct string* s ); extern struct string* string_vprintf( gchar* fmt, va_list args ); extern struct string* string_printf( gchar* fmt, ... ); extern gsize string_concat( gchar** result, struct string* s, ... ); -extern int string_compare( struct string* s1, struct string* s2 ); +extern gboolean string_equal( struct string* s1, struct string* s2 ); /* misc global stuff */ extern HANDLE service_stop_event; |