rpms/lirc/F-9 lirc-0.8.3-validate-transmit-buffer.patch, NONE, 1.1 lirc-dont-exit.patch, NONE, 1.1 lirc.spec, 1.31, 1.32

Jarod Wilson jwilson at fedoraproject.org
Tue Sep 16 13:50:22 UTC 2008


Author: jwilson

Update of /cvs/pkgs/rpms/lirc/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20168

Modified Files:
	lirc.spec 
Added Files:
	lirc-0.8.3-validate-transmit-buffer.patch lirc-dont-exit.patch 
Log Message:
* Tue Sep 16 2008 Jarod Wilson <jarod at redhat.com> - 0.8.3-2
- Fix multilib upgrade path from F8 (Nicolas Chauvet, #462435)
- Include upstream patch to validate transmit buffers
- Make lircd not exit when there's no device available, so that the
  daemon is running as expected when the hardware is plugged back in
  (Bastien Nocera, #440231)


lirc-0.8.3-validate-transmit-buffer.patch:

--- NEW FILE lirc-0.8.3-validate-transmit-buffer.patch ---
--- lirc/daemons/transmit.c	2007/07/29 18:20:13	5.27
+++ lirc/daemons/transmit.c	2008/05/11 13:29:47	5.28
@@ -1,4 +1,4 @@
-/*      $Id: transmit.c,v 5.27 2007/07/29 18:20:13 lirc Exp $      */
+/*      $Id: transmit.c,v 5.28 2008/05/11 13:29:47 lirc Exp $      */
 
 /****************************************************************************
  ** transmit.c **************************************************************
@@ -116,6 +116,34 @@
 	return(0);
 }
 
+static int check_send_buffer(void)
+{
+	int i;
+
+	if (send_buffer.wptr == 0) 
+	{
+		LOGPRINTF(1, "nothing to send");
+		return(0);
+	}
+	for (i = 0; i < send_buffer.wptr; i++)
+	{
+		if(send_buffer.data[i] == 0)
+		{
+			if(i%2)
+			{
+				LOGPRINTF(1, "invalid space: %d", i);
+			}
+			else
+			{
+				LOGPRINTF(1, "invalid pulse: %d", i);
+			}
+			return 0;
+		}
+	}
+	
+	return 1;
+}
+
 static inline void flush_send_buffer(void)
 {
 	if(send_buffer.pendingp>0)
@@ -500,5 +528,13 @@
 		goto init_send_loop;
 	}
 	LOGPRINTF(3, "transmit buffer ready");
-	return(1);
+	if(!check_send_buffer())
+	{
+		logprintf(LOG_ERR, "invalid send buffer");
+		logprintf(LOG_ERR,
+			  "this remote configuration cannot be used "
+			  "to transmit");
+		return 0;
+	}
+	return 1;
 }

lirc-dont-exit.patch:

--- NEW FILE lirc-dont-exit.patch ---
--- daemons/lircd.c	2008/05/09 18:40:59	5.77
+++ daemons/lircd.c	2008/08/21 18:39:25	5.78
@@ -515,10 +515,13 @@
 		{
 			if(!hw.init_func())
 			{
-				shutdown(clis[0],2);
-				close(clis[0]);
-				clin=0;
-				dosigterm(SIGTERM);
+				logprintf(LOG_WARNING,
+					  "Failed to initialize hardware");
+				/* Don't exit here, otherwise lirc
+				 * bails out, and lircd exits, making
+				 * it impossible to connect to when we
+				 * have a device actually plugged
+				 * in. */
 			}
 		}
 	}


Index: lirc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/lirc/F-9/lirc.spec,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- lirc.spec	4 May 2008 18:21:52 -0000	1.31
+++ lirc.spec	16 Sep 2008 13:49:52 -0000	1.32
@@ -18,7 +18,7 @@
 
 Name:           lirc
 Version:        0.8.3
-Release:        1%{?pre:.%{pre}}%{?dist}
+Release:        2%{?pre:.%{pre}}%{?dist}
 Summary:        The Linux Infrared Remote Control package
 
 Group:          System Environment/Daemons
@@ -28,6 +28,8 @@
 #Source0:        http://lirc.sourceforge.net/software/snapshots/%{name}-%{version}%{pre}.tar.bz2
 Source1:        %{name}.init
 Source2:        %{name}.sysconfig
+Patch0:         lirc-0.8.3-validate-transmit-buffer.patch
+Patch1:         lirc-dont-exit.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  %{__perl}
@@ -60,6 +62,8 @@
 %package        libs
 Summary:        LIRC libraries
 Group:          System Environment/Libraries
+# Fix old F8 multilib upgrade path issue
+Obsoletes:      %{name} < 0.8.3
 
 %description    libs
 LIRC is a package that allows you to decode and send infra-red and
@@ -97,6 +101,8 @@
 
 %prep
 %setup -q -n %{name}-%{version}%{?pre}
+%patch0 -p1 -b .xbuf
+%patch1 -p1 -b .exit
 
 chmod 644 contrib/*
 
@@ -233,6 +239,13 @@
 
 
 %changelog
+* Tue Sep 16 2008 Jarod Wilson <jarod at redhat.com> - 0.8.3-2
+- Fix multilib upgrade path from F8 (Nicolas Chauvet, #462435)
+- Include upstream patch to validate transmit buffers
+- Make lircd not exit when there's no device available, so that the
+  daemon is running as expected when the hardware is plugged back in
+  (Bastien Nocera, #440231)
+
 * Sun May 04 2008 Jarod Wilson <jwilson at redhat.com> - 0.8.3-1
 - Update to 0.8.3 release
 




More information about the fedora-extras-commits mailing list