From 0ddce65214d2f162b389910d4cb74d664bed562d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 20 Dec 2012 20:00:06 +0000 Subject: fclose() and fflush() are standard C routines, so there's no need for our own wrappers. (pcapio.c isn't using wrappers around, for example, fwrite().) svn path=/trunk/; revision=46640 --- dumpcap.c | 12 ++++++------ ringbuffer.c | 8 ++++---- wsutil/file_util.h | 4 ---- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/dumpcap.c b/dumpcap.c index 6df3a0d5f2..0eb959c009 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -2952,7 +2952,7 @@ capture_loop_close_output(capture_options *capture_opts, loop_data *ld, int *err } } } - if (ws_fclose(ld->pdh) == EOF) { + if (fclose(ld->pdh) == EOF) { if (err_close != NULL) { *err_close = errno; } @@ -3374,7 +3374,7 @@ do_file_switch_or_stop(capture_options *capture_opts, cnd_reset(cnd_autostop_size); if (cnd_file_duration) cnd_reset(cnd_file_duration); - ws_fflush(global_ld.pdh); + fflush(global_ld.pdh); if (!quiet) report_packet_count(global_ld.inpkts_to_sync_pipe); global_ld.inpkts_to_sync_pipe = 0; @@ -3525,7 +3525,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct message to our parent so that they'll open the capture file and update its windows to indicate that we have a live capture in progress. */ - ws_fflush(global_ld.pdh); + fflush(global_ld.pdh); report_new_capture_file(capture_opts->save_file); } @@ -3642,7 +3642,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct continue; } /* cnd_autostop_size */ if (capture_opts->output_to_pipe) { - ws_fflush(global_ld.pdh); + fflush(global_ld.pdh); } } /* inpkts */ @@ -3671,7 +3671,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct /* Let the parent process know. */ if (global_ld.inpkts_to_sync_pipe) { /* do sync here */ - ws_fflush(global_ld.pdh); + fflush(global_ld.pdh); /* Send our parent a message saying we've written out "global_ld.inpkts_to_sync_pipe" packets to the capture file. */ @@ -3731,7 +3731,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct g_free(queue_element); global_ld.inpkts_to_sync_pipe += 1; if (capture_opts->output_to_pipe) { - ws_fflush(global_ld.pdh); + fflush(global_ld.pdh); } } } diff --git a/ringbuffer.c b/ringbuffer.c index c5a095dfff..beffca5a24 100644 --- a/ringbuffer.c +++ b/ringbuffer.c @@ -250,7 +250,7 @@ ringbuf_switch_file(FILE **pdh, gchar **save_file, int *save_file_fd, int *err) /* close current file */ - if (ws_fclose(rb_data.pdh) == EOF) { + if (fclose(rb_data.pdh) == EOF) { if (err != NULL) { *err = errno; } @@ -286,7 +286,7 @@ ringbuf_switch_file(FILE **pdh, gchar **save_file, int *save_file_fd, int *err) } /* - * Calls ws_fclose() for the current ringbuffer file + * Calls fclose() for the current ringbuffer file */ gboolean ringbuf_libpcap_dump_close(gchar **save_file, int *err) @@ -295,7 +295,7 @@ ringbuf_libpcap_dump_close(gchar **save_file, int *err) /* close current file, if it's open */ if (rb_data.pdh != NULL) { - if (ws_fclose(rb_data.pdh) == EOF) { + if (fclose(rb_data.pdh) == EOF) { if (err != NULL) { *err = errno; } @@ -349,7 +349,7 @@ ringbuf_error_cleanup(void) /* try to close via wtap */ if (rb_data.pdh != NULL) { - if (ws_fclose(rb_data.pdh) == 0) { + if (fclose(rb_data.pdh) == 0) { rb_data.fd = -1; } rb_data.pdh = NULL; diff --git a/wsutil/file_util.h b/wsutil/file_util.h index 09c5c64af9..4710aa6a15 100644 --- a/wsutil/file_util.h +++ b/wsutil/file_util.h @@ -95,8 +95,6 @@ extern FILE * ws_stdio_freopen (const gchar *filename, const gchar *mode, FILE * #define ws_fstat64 _fstati64 /* use _fstati64 for 64-bit size support */ #define ws_lseek64 _lseeki64 /* use _lseeki64 for 64-bit offset support */ #define ws_fdopen _fdopen -#define ws_fclose fclose -#define ws_fflush fflush /* DLL loading */ @@ -153,8 +151,6 @@ extern char *getenv_utf8(const char *varname); #define ws_fstat64 fstat /* AC_SYS_LARGEFILE should make off_t 64-bit */ #define ws_lseek64 lseek /* AC_SYS_LARGEFILE should make off_t 64-bit */ #define ws_fdopen fdopen -#define ws_fclose fclose -#define ws_fflush fflush #define O_BINARY 0 /* Win32 needs the O_BINARY flag for open() */ #endif /* _WIN32 */ -- cgit v1.2.3