[vlc-commits] commit: Framebuffer: don't register useless signal handler ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sat Jul 10 11:51:15 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jul 10 12:49:16 2010 +0300| [b1a700d1e3e5432235afe6179f67d2d13707a3a3] | committer: Rémi Denis-Courmont 

Framebuffer: don't register useless signal handler

The signal handler currently does nothing anyway, so this was a waste.

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

 modules/video_output/fb.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c
index a30e62d..ecd5f34 100644
--- a/modules/video_output/fb.c
+++ b/modules/video_output/fb.c
@@ -108,7 +108,9 @@ static void           Manage (vout_display_t *);
 /* */
 static int  OpenDisplay  (vout_display_t *, bool force_resolution);
 static void CloseDisplay (vout_display_t *);
+#if 0
 static void SwitchDisplay(int i_signal);
+#endif
 static void TextMode     (int tty);
 static void GfxMode      (int tty);
 
@@ -123,8 +125,10 @@ struct vout_display_sys_t {
     struct termios      old_termios;
 
     /* Original configuration information */
+#if 0
     struct sigaction            sig_usr1;           /* USR1 previous handler */
     struct sigaction            sig_usr2;           /* USR2 previous handler */
+#endif
     struct vt_mode              vt_mode;                 /* previous VT mode */
 
     /* Framebuffer information */
@@ -456,6 +460,7 @@ static int TtyInit(vout_display_t *vd)
 
     ioctl(sys->tty, VT_RELDISP, VT_ACKACQ);
 
+#if 0
     /* Set-up tty signal handler to be aware of tty changes */
     struct sigaction sig_tty;
     memset(&sig_tty, 0, sizeof(sig_tty));
@@ -467,6 +472,7 @@ static int TtyInit(vout_display_t *vd)
         /* FIXME SIGUSR1 could have succeed */
         goto error_signal;
     }
+#endif
 
     /* Set-up tty according to new signal handler */
     if (-1 == ioctl(sys->tty, VT_GETMODE, &sys->vt_mode)) {
@@ -486,9 +492,11 @@ static int TtyInit(vout_display_t *vd)
     return VLC_SUCCESS;
 
 error:
+#if 0
     sigaction(SIGUSR1, &sys->sig_usr1, NULL);
     sigaction(SIGUSR2, &sys->sig_usr2, NULL);
 error_signal:
+#endif
     tcsetattr(0, 0, &sys->old_termios);
     TextMode(sys->tty);
     return VLC_EGENERIC;
@@ -500,9 +508,11 @@ static void TtyExit(vout_display_t *vd)
     /* Reset the terminal */
     ioctl(sys->tty, VT_SETMODE, &sys->vt_mode);
 
+#if 0
     /* Remove signal handlers */
     sigaction(SIGUSR1, &sys->sig_usr1, NULL);
     sigaction(SIGUSR2, &sys->sig_usr2, NULL);
+#endif
 
     /* Reset the keyboard state */
     tcsetattr(0, 0, &sys->old_termios);
@@ -701,6 +711,7 @@ static void CloseDisplay(vout_display_t *vd)
     }
 }
 
+#if 0
 /*****************************************************************************
  * SwitchDisplay: VT change signal handler
  *****************************************************************************
@@ -709,8 +720,6 @@ static void CloseDisplay(vout_display_t *vd)
  *****************************************************************************/
 static void SwitchDisplay(int i_signal)
 {
-    VLC_UNUSED(i_signal);
-#if 0
     vout_display_t *vd;
 
     vlc_mutex_lock(&p_vout_bank->lock);
@@ -738,8 +747,8 @@ static void SwitchDisplay(int i_signal)
     }
 
     vlc_mutex_unlock(&p_vout_bank->lock);
-#endif
 }
+#endif
 
 /*****************************************************************************
  * TextMode and GfxMode : switch tty to text/graphic mode



More information about the vlc-commits mailing list