[vlc-commits] XCB: use vlc_strerror_c()

Rémi Denis-Courmont git at videolan.org
Sun Dec 29 15:16:28 CET 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Dec 28 19:57:31 2013 +0200| [d610d175515bb89919ef96518798080b9d827630] | committer: Rémi Denis-Courmont

XCB: use vlc_strerror_c()

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

 modules/access/screen/xcb.c         |    7 +++++--
 modules/video_output/xcb/pictures.c |    7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/access/screen/xcb.c b/modules/access/screen/xcb.c
index d3a5078..e17fddf 100644
--- a/modules/access/screen/xcb.c
+++ b/modules/access/screen/xcb.c
@@ -25,6 +25,7 @@
 #endif
 #include <stdarg.h>
 #include <assert.h>
+#include <errno.h>
 #include <xcb/xcb.h>
 #include <xcb/composite.h>
 #ifdef HAVE_SYS_SHM_H
@@ -438,7 +439,8 @@ discard:
         int id = shmget (IPC_PRIVATE, size, IPC_CREAT | 0777);
         if (id == -1) /* XXX: fallback */
         {
-            msg_Err (demux, "shared memory allocation error: %m");
+            msg_Err (demux, "shared memory allocation error: %s",
+                     vlc_strerror_c(errno));
             goto noshm;
         }
 
@@ -465,7 +467,8 @@ discard:
         shmctl (id, IPC_RMID, 0);
         if (-1 == (intptr_t)shm)
         {
-            msg_Err (demux, "shared memory attachment error: %m");
+            msg_Err (demux, "shared memory attachment error: %s",
+                     vlc_strerror_c(errno));
             return;
         }
 
diff --git a/modules/video_output/xcb/pictures.c b/modules/video_output/xcb/pictures.c
index f4311d1..b2c1fce 100644
--- a/modules/video_output/xcb/pictures.c
+++ b/modules/video_output/xcb/pictures.c
@@ -26,6 +26,7 @@
 
 #include <stdlib.h>
 #include <assert.h>
+#include <errno.h>
 
 #include <sys/types.h>
 #ifdef HAVE_SYS_SHM_H
@@ -90,7 +91,8 @@ int XCB_picture_Alloc (vout_display_t *vd, picture_resource_t *res,
     int id = shmget (IPC_PRIVATE, size, IPC_CREAT | S_IRWXU);
     if (id == -1)
     {
-        msg_Err (vd, "shared memory allocation error: %m");
+        msg_Err (vd, "shared memory allocation error: %s",
+                 vlc_strerror_c(errno));
         return -1;
     }
 
@@ -98,7 +100,8 @@ int XCB_picture_Alloc (vout_display_t *vd, picture_resource_t *res,
     void *shm = shmat (id, NULL, 0 /* read/write */);
     if (-1 == (intptr_t)shm)
     {
-        msg_Err (vd, "shared memory attachment error: %m");
+        msg_Err (vd, "shared memory attachment error: %s",
+                 vlc_strerror_c(errno));
         shmctl (id, IPC_RMID, 0);
         return -1;
     }



More information about the vlc-commits mailing list