[vlc-commits] Linux FB: use vlc_strerror_c()
Rémi Denis-Courmont
git at videolan.org
Sun Dec 29 15:16:30 CET 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 29 15:38:57 2013 +0200| [d0b09d6ff8b7e8d32a667d9a2292c7102a030eb2] | committer: Rémi Denis-Courmont
Linux FB: use vlc_strerror_c()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0b09d6ff8b7e8d32a667d9a2292c7102a030eb2
---
modules/video_output/fb.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c
index e9b44e6..78c480a 100644
--- a/modules/video_output/fb.c
+++ b/modules/video_output/fb.c
@@ -33,7 +33,7 @@
#include <signal.h> /* SIGUSR1, SIGUSR2 */
#include <fcntl.h> /* open() */
#include <unistd.h> /* close() */
-
+#include <errno.h>
#include <termios.h> /* struct termios */
#include <sys/ioctl.h>
#include <sys/mman.h> /* mmap() */
@@ -450,7 +450,7 @@ static int TtyInit(vout_display_t *vd)
sigemptyset(&sig_tty.sa_mask);
if (sigaction(SIGUSR1, &sig_tty, &sys->sig_usr1) ||
sigaction(SIGUSR2, &sig_tty, &sys->sig_usr2)) {
- msg_Err(vd, "cannot set signal handler (%m)");
+ msg_Err(vd, "cannot set signal handler (%s)", vlc_strerror_c(errno));
/* FIXME SIGUSR1 could have succeed */
goto error_signal;
}
@@ -458,7 +458,7 @@ static int TtyInit(vout_display_t *vd)
/* Set-up tty according to new signal handler */
if (-1 == ioctl(sys->tty, VT_GETMODE, &sys->vt_mode)) {
- msg_Err(vd, "cannot get terminal mode (%m)");
+ msg_Err(vd, "cannot get terminal mode (%s)", vlc_strerror_c(errno));
goto error;
}
struct vt_mode vt_mode = sys->vt_mode;
@@ -468,7 +468,7 @@ static int TtyInit(vout_display_t *vd)
vt_mode.acqsig = SIGUSR2;
if (-1 == ioctl(sys->tty, VT_SETMODE, &vt_mode)) {
- msg_Err(vd, "cannot set terminal mode (%m)");
+ msg_Err(vd, "cannot set terminal mode (%s)", vlc_strerror_c(errno));
goto error;
}
return VLC_SUCCESS;
@@ -519,7 +519,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
sys->fd = vlc_open(psz_device, O_RDWR);
if (sys->fd == -1) {
- msg_Err(vd, "cannot open %s (%m)", psz_device);
+ msg_Err(vd, "cannot open %s (%s)", psz_device, vlc_strerror_c(errno));
free(psz_device);
return VLC_EGENERIC;
}
@@ -527,7 +527,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
/* Get framebuffer device information */
if (ioctl(sys->fd, FBIOGET_VSCREENINFO, &sys->var_info)) {
- msg_Err(vd, "cannot get fb info (%m)");
+ msg_Err(vd, "cannot get fb info (%s)", vlc_strerror_c(errno));
close(sys->fd);
return VLC_EGENERIC;
}
@@ -546,7 +546,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
sys->var_info.yoffset = 0;
if (ioctl(sys->fd, FBIOPUT_VSCREENINFO, &sys->var_info)) {
- msg_Err(vd, "cannot set fb info (%m)");
+ msg_Err(vd, "cannot set fb info (%s)", vlc_strerror_c(errno));
close(sys->fd);
return VLC_EGENERIC;
}
@@ -555,7 +555,8 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
/* Get some information again, in the definitive configuration */
if (ioctl(sys->fd, FBIOGET_FSCREENINFO, &fix_info) ||
ioctl(sys->fd, FBIOGET_VSCREENINFO, &sys->var_info)) {
- msg_Err(vd, "cannot get additional fb info (%m)");
+ msg_Err(vd, "cannot get additional fb info (%s)",
+ vlc_strerror_c(errno));
/* Restore fb config */
ioctl(sys->fd, FBIOPUT_VSCREENINFO, &sys->old_info);
@@ -642,7 +643,7 @@ static int OpenDisplay(vout_display_t *vd, bool force_resolution)
PROT_READ | PROT_WRITE, MAP_SHARED, sys->fd, 0);
if (sys->video_ptr == MAP_FAILED) {
- msg_Err(vd, "cannot map video memory (%m)");
+ msg_Err(vd, "cannot map video memory (%s)", vlc_strerror_c(errno));
if (sys->var_info.bits_per_pixel == 8) {
free(sys->palette);
More information about the vlc-commits
mailing list