]> git.sesse.net Git - vlc/blobdiff - modules/access_filter/dump.c
We only support RTSP one point ZERO. Do not claim otherwise.
[vlc] / modules / access_filter / dump.c
index 38139d0adfa6b13f73c570ec71e8125c0c71f5ba..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;
     }
 
@@ -251,7 +249,7 @@ static inline struct tm *localtime_r (const time_t *now, struct tm *res)
      * This is not thread-safe. Blame your C library.
      * On Win32 there SHOULD be _localtime_s instead, but of course
      * Cygwin and Mingw32 don't know about it. You're on your own if you
-     * this platform.
+     * use this platform.
      */
     if (unsafe == NULL)
         return NULL;
@@ -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;
         }
     }