[libdvbpsi-devel] examples/dvbinfo/dvbinfo.c: Handle rename errors (CID 17233)

Jean-Paul Saman git at videolan.org
Wed Apr 16 15:53:34 CEST 2014


libdvbpsi | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Fri Apr 11 17:02:06 2014 +0200| [a69ffcddda22eb9c5d26adc01c0aaa0207b6fb1e] | committer: Jean-Paul Saman

examples/dvbinfo/dvbinfo.c: Handle rename errors (CID 17233)

> http://git.videolan.org/gitweb.cgi/libdvbpsi.git/?a=commit;h=a69ffcddda22eb9c5d26adc01c0aaa0207b6fb1e
---

 examples/dvbinfo/dvbinfo.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/dvbinfo/dvbinfo.c b/examples/dvbinfo/dvbinfo.c
index 223b9c4..5ca7ea0 100644
--- a/examples/dvbinfo/dvbinfo.c
+++ b/examples/dvbinfo/dvbinfo.c
@@ -398,7 +398,13 @@ static int dvbinfo_process(dvbinfo_capture_t *capture)
                     fflush(fd);
                     fclose(fd);
                     unlink(param->summary.file);
-                    rename(psz_temp, param->summary.file);
+                    int ret = rename(psz_temp, param->summary.file);
+                    if (ret < 0)
+                    {
+                        libdvbpsi_log(param, DVBINFO_LOG_ERROR,
+                                      "failed renming summary file (disabling summary logging)\n");
+                        param->b_summary = false;
+                    }
                 }
                 else
                 {



More information about the libdvbpsi-devel mailing list