diff options
author | William Jon McCann <mccann@jhu.edu> | 2008-02-01 14:20:00 -0500 |
---|---|---|
committer | William Jon McCann <mccann@jhu.edu> | 2008-02-01 14:20:00 -0500 |
commit | 076d63698c204427b210a2da76dc1b7e6640bbb9 (patch) | |
tree | 4d7f586953e349c6a578272dc68b6f2de9c13e74 /src/ck-log-event.c | |
parent | 185c0f5169dbcb55854491d9ab642c7b5c6418ca (diff) |
when a parsing error occurs don't return an empty event
Diffstat (limited to 'src/ck-log-event.c')
-rw-r--r-- | src/ck-log-event.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ck-log-event.c b/src/ck-log-event.c index f099b89..7e8ce10 100644 --- a/src/ck-log-event.c +++ b/src/ck-log-event.c @@ -711,7 +711,7 @@ parse_log_for_seat_added (const GString *str, res = g_match_info_matches (match_info); if (! res) { - g_warning ("Unable to parse event: %s", s); + g_warning ("Unable to parse seat added event: %s", s); goto out; } @@ -771,7 +771,7 @@ parse_log_for_seat_removed (const GString *str, res = g_match_info_matches (match_info); if (! res) { - g_warning ("Unable to parse event: %s", s); + g_warning ("Unable to parse seat removed event: %s", s); goto out; } @@ -900,7 +900,7 @@ parse_log_for_seat_session_added (const GString *str, res = g_match_info_matches (match_info); if (! res) { - g_warning ("Unable to parse event: %s", s); + g_warning ("Unable to parse session added event: %s", s); goto out; } @@ -975,7 +975,7 @@ parse_log_for_seat_session_removed (const GString *str, res = g_match_info_matches (match_info); if (! res) { - g_warning ("Unable to parse event: %s", s); + g_warning ("Unable to parse session removed event: %s", s); goto out; } @@ -1049,7 +1049,7 @@ parse_log_for_seat_active_session_changed (const GString *str, res = g_match_info_matches (match_info); if (! res) { - g_warning ("Unable to parse event: %s", s); + g_warning ("Unable to parse session changed event: %s", s); goto out; } @@ -1101,7 +1101,7 @@ parse_log_for_seat_device_added (const GString *str, res = g_match_info_matches (match_info); if (! res) { - g_warning ("Unable to parse event: %s", s); + g_warning ("Unable to parse device added event: %s", s); goto out; } @@ -1154,7 +1154,7 @@ parse_log_for_seat_device_removed (const GString *str, res = g_match_info_matches (match_info); if (! res) { - g_warning ("Unable to parse event: %s", s); + g_warning ("Unable to parse device removed event: %s", s); goto out; } @@ -1269,11 +1269,16 @@ CkLogEvent * ck_log_event_new_from_string (const GString *str) { CkLogEvent *event; + gboolean res; g_return_val_if_fail (str != NULL, NULL); event = g_new0 (CkLogEvent, 1); - ck_log_event_fill_from_string (event, str); + res = ck_log_event_fill_from_string (event, str); + if (! res) { + g_free (event); + event = NULL; + } return event; } |