diff options
author | phintuka <phintuka> | 2007-01-19 20:17:16 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2007-01-19 20:17:16 +0000 |
commit | e3583ecc53ebf6a10f6ffe7c0c777dafb34218f0 (patch) | |
tree | 835a1b67f0c918955ccf305a0ee29d6eb9ae98f5 | |
parent | 3308d49ca81090b1a7cfa06926440923ec774be8 (diff) | |
download | xineliboutput-e3583ecc53ebf6a10f6ffe7c0c777dafb34218f0.tar.gz xineliboutput-e3583ecc53ebf6a10f6ffe7c0c777dafb34218f0.tar.bz2 |
Check result of fopen before write
-rw-r--r-- | tools/udp_pes_scheduler.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c index 28eb6af6..16418e04 100644 --- a/tools/udp_pes_scheduler.c +++ b/tools/udp_pes_scheduler.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: udp_pes_scheduler.c,v 1.21 2007-01-06 04:27:03 phintuka Exp $ + * $Id: udp_pes_scheduler.c,v 1.22 2007-01-19 20:17:16 phintuka Exp $ * */ @@ -517,8 +517,10 @@ void cUdpScheduler::Send_SAP(bool Announce) if(m_fd_sap < 0) { cString fname = cString::sprintf("/video/xineliboutput@%s.sdp", ip); FILE *fp = fopen(fname, "w"); - fprintf(fp, "%s", sdp_descr); - fclose(fp); + if(fp) { + fprintf(fp, "%s", sdp_descr); + fclose(fp); + } } #endif sap_pdu_t *pdu = sap_create_pdu(local_addr, |