]> git.sesse.net Git - vlc/blobdiff - modules/access_filter/dump.c
Replace strerror() with %m (or Linux DVB: strerror_r) - refs #1297
[vlc] / modules / access_filter / dump.c
index 074fb3ec765adece188a5d0360134cd57e9c1e31..22d2e8a60270f990ae26a35ce9f0dc043768bb6b 100644 (file)
@@ -23,8 +23,6 @@
 
 #include <vlc/vlc.h>
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <assert.h>
 #include <time.h>
 #include <errno.h>
@@ -113,7 +111,7 @@ static int Open (vlc_object_t *obj)
 
     if ((p_sys->stream = tmpfile ()) == NULL)
     {
-        msg_Err (access, "cannot create temporary file: %s", strerror (errno));
+        msg_Err (access, "cannot create temporary file: %m");
         free (p_sys);
         return VLC_EGENERIC;
     }
@@ -169,7 +167,7 @@ static void Dump (access_t *access, const uint8_t *buffer, size_t len)
     assert (len > 0);
     if (fwrite (buffer, len, 1, stream) != 1)
     {
-        msg_Err (access, "cannot write to file: %s", strerror (errno));
+        msg_Err (access, "cannot write to file: %m");
         goto error;
     }
 
@@ -296,8 +294,7 @@ static void Trigger (access_t *access)
     FILE *newstream = utf8_fopen (filename, "wb");
     if (newstream == NULL)
     {
-        msg_Err (access, "cannot create dump file \"%s\": %s", filename,
-                 strerror (errno));
+        msg_Err (access, "cannot create dump file \"%s\": %m", filename);
         return;
     }
 
@@ -313,8 +310,7 @@ static void Trigger (access_t *access)
         {
             if (ferror (oldstream))
             {
-                msg_Err (access, "cannot read temporary file: %s",
-                         strerror (errno));
+                msg_Err (access, "cannot read temporary file: %m");
                 break;
             }
 
@@ -327,7 +323,7 @@ static void Trigger (access_t *access)
 
         if (fwrite (buf, len, 1, newstream) != 1)
         {
-            msg_Err (access, "cannot write dump file: %s", strerror (errno));
+            msg_Err (access, "cannot write dump file: %m");
             break;
         }
     }