/* capture_stop_conditions.c
* Implementation for 'stop condition handler'.
*
- * $Id: capture_stop_conditions.c,v 1.4 2002/08/28 21:00:05 jmayer Exp $
+ * $Id$
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
static condition* _cnd_constr_timeout(condition* cnd, va_list ap){
cnd_timeout_dat *data = NULL;
/* allocate memory */
- if((data = (cnd_timeout_dat*)malloc(sizeof(cnd_timeout_dat))) == NULL)
+ if((data = (cnd_timeout_dat*)g_malloc(sizeof(cnd_timeout_dat))) == NULL)
return NULL;
/* initialize user data */
data->start_time = time(NULL);
*/
static void _cnd_destr_timeout(condition* cnd){
/* free memory */
- free(cnd_get_user_data(cnd));
+ g_free(cnd_get_user_data(cnd));
} /* END _cnd_destr_timeout() */
/*
gint32 elapsed_time;
/* check timeout here */
if(data->timeout_s == 0) return FALSE; /* 0 == infinite */
- elapsed_time = time(NULL) - data->start_time;
- if(elapsed_time > data->timeout_s) return TRUE;
+ elapsed_time = (gint32) (time(NULL) - data->start_time);
+ if(elapsed_time >= data->timeout_s) return TRUE;
return FALSE;
} /* END _cnd_eval_timeout()*/
static condition* _cnd_constr_capturesize(condition* cnd, va_list ap){
cnd_capturesize_dat *data = NULL;
/* allocate memory */
- if((data = (cnd_capturesize_dat*)malloc(sizeof(cnd_capturesize_dat))) == NULL)
+ if((data = (cnd_capturesize_dat*)g_malloc(sizeof(cnd_capturesize_dat))) == NULL)
return NULL;
/* initialize user data */
data->max_capture_size = va_arg(ap, long);
*/
static void _cnd_destr_capturesize(condition* cnd){
/* free memory */
- free(cnd_get_user_data(cnd));
+ g_free(cnd_get_user_data(cnd));
} /* END _cnd_destr_capturesize() */
/*