Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] 1.1.19 and learning keys without STDIN




  Hi all,

May I suggest this quick fix to handle the case when 1.1.19 tries to
learn keys without connection to keyboard.  Also closing the input
descriptor in runvdr script with <&- might be necessary in some
situations.

diff -ru old/vdr-1.1.19/vdr.c vdr-1.1.19/vdr.c
--- old/vdr-1.1.19/vdr.c	Sun Dec  8 15:34:39 2002
+++ vdr-1.1.19/vdr.c	Mon Dec  9 00:13:11 2002
@@ -81,7 +81,7 @@
   // Save terminal settings:

   struct termios savedTm;
-  tcgetattr(STDIN_FILENO, &savedTm);
+  bool has_stdin = !tcgetattr(STDIN_FILENO, &savedTm);

   // Initiate locale:

@@ -386,7 +386,7 @@
   new cLircRemote("/dev/lircd");
 #endif
 #if defined(REMOTE_KBD)
-  if (!DaemonMode)
+  if (!DaemonMode && has_stdin)
      new cKbdRemote;
 #endif
   Interface->LearnKeys();
@@ -724,7 +724,8 @@
   isyslog("exiting");
   if (SysLogLevel > 0)
      closelog();
-  tcsetattr(STDIN_FILENO, TCSANOW, &savedTm);
+  if (has_stdin)
+     tcsetattr(STDIN_FILENO, TCSANOW, &savedTm);
   if (cThread::EmergencyExit()) {
      esyslog("emergency exit!");
      return 1;

-- 
Foreca Ltd                                           Jaakko.Hyvatti@foreca.com
Pursimiehenkatu 29-31 B, FIN-00150 Helsinki, Finland     http://www.foreca.com
-- 
Jaakko.Hyvatti@iki.fi         http://www.iki.fi/hyvatti/        +358 40 5011222
echo 'movl $36,%eax;int $128;movl $0,%ebx;movl $1,%eax;int $128'|as -o/bin/sync



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index