diff options
author | Gerald Combs <gerald@wireshark.org> | 2003-05-28 01:09:57 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2003-05-28 01:09:57 +0000 |
commit | 578640772d78f5f29ed990b2718431661ebaa001 (patch) | |
tree | ebaeb48dfe74aef827d2b90d75df833954faacdb /gtk | |
parent | 10e7b49b11d164560f4cc30ffa2577f4fc69b0e6 (diff) | |
download | wireshark-578640772d78f5f29ed990b2718431661ebaa001.tar.gz wireshark-578640772d78f5f29ed990b2718431661ebaa001.tar.bz2 wireshark-578640772d78f5f29ed990b2718431661ebaa001.zip |
Use freopen() instead of worrying about whether a particular FILE pointer is
NULL.
svn path=/trunk/; revision=7754
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/tap_rtp.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/gtk/tap_rtp.c b/gtk/tap_rtp.c index 6938490cd8..d015e5b3b1 100644 --- a/gtk/tap_rtp.c +++ b/gtk/tap_rtp.c @@ -1,7 +1,7 @@ /* * tap_rtp.c * - * $Id: tap_rtp.c,v 1.12 2003/05/27 01:40:30 gerald Exp $ + * $Id: tap_rtp.c,v 1.13 2003/05/28 01:09:57 gerald Exp $ * * RTP analysing addition for ethereal * @@ -74,14 +74,6 @@ * * XXX Problems: * - * - instead of tmpnam() use of mkstemp(). - * I tried to do it with mkstemp() but didn't now how to solve following problem: - * I call mkstemp() and then write in this temp file and it works fine . But if the user - * then hits the refresh button, this temp file should be deleted and opened again. I tried - * to call close() and unlink(), but when I call mkstemp() for the second time I always get - * an error ( -1) as return value. What is the correct order? Is it possible to call - * mkstemp() twice with the same template? - * * - problem with statistics for lost (late, duplicated) packets. How to make the statistic * more resistant to special (bizarre) arrival of sequence numbers */ @@ -237,15 +229,10 @@ rtp_reset(void *prs) rs->forward.count = 0; rs->reversed.count = 0; /* XXX check for error at fclose? */ - /* XXX - Should we just use freopen instead? */ - if (rs->forward.fp != NULL) - fclose(rs->forward.fp); - if (rs->reversed.fp != NULL) - fclose(rs->reversed.fp); - rs->forward.fp = fopen(f_tempname, "wb"); + rs->forward.fp = freopen(f_tempname, "wb", rs->forward.fp); if (rs->forward.fp == NULL) rs->forward.error_type = TAP_RTP_FILE_OPEN_ERROR; - rs->reversed.fp = fopen(r_tempname, "wb"); + rs->reversed.fp = freopen(r_tempname, "wb", rs->reversed.fp); if (rs->reversed.fp == NULL) rs->reversed.error_type = TAP_RTP_FILE_OPEN_ERROR; return; |