Commit 86f2543c authored by Mike Frysinger's avatar Mike Frysinger Committed by Peter Korsgaard
Browse files

irda-utils: new package for IrDA devices



[Peter: Small tweaks, add patch descriptions]
Acked-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent 921f75e2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ source "package/hwdata/Config.in"
source "package/i2c-tools/Config.in"
source "package/input-tools/Config.in"
source "package/iostat/Config.in"
source "package/irda-utils/Config.in"
source "package/kbd/Config.in"
source "package/lm-sensors/Config.in"
source "package/lsuio/Config.in"
+19 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_IRDA_UTILS
	bool "irda-utils"
	help
	  user space utilities which control the IrDA stack

	  http://irda.sourceforge.net/

if BR2_PACKAGE_IRDA_UTILS

config BR2_PACKAGE_IRDA_UTILS_IRATTACH
	bool "irattach"

config BR2_PACKAGE_IRDA_UTILS_IRDAPING
	bool "irdaping"

config BR2_PACKAGE_IRDA_UTILS_IRNETD
	bool "irnetd"

endif
+34 −0
Original line number Diff line number Diff line
written by Mike Frysinger

https://sourceforge.net/tracker/?func=detail&aid=3132053&group_id=5616&atid=305616

Rather than using the fork function (which doesnt work on nommu
systems), simply use the daemon() function instead (which does
work). this should work the same before and after for all systems.

--- a/irattach/util.c
+++ b/irattach/util.c
@@ -156,21 +156,10 @@
 
 void fork_now(int ttyfd)
 {
-	int ret;
 	int i;
 
-	if ((ret = fork()) > 0)
-		exit(0);
-	
-	if (ret == -1)
-		syslog(LOG_INFO, "forking: %m");
-	if (setsid() < 0)
-		syslog(LOG_INFO, "detaching from tty: %m");
-
-	if ((ret = fork()) > 0) {
-		/* cleanup_files = 0; */
-		exit(0);
-	}
+	if (daemon(1, 1))
+		syslog(LOG_INFO, "daemon: %m");
 
 	/* Close all open inherited files! Except for ttyfd! */
 	for (i = 0; i < 64; i++)
+24 −0
Original line number Diff line number Diff line
written by Mike Frysinger

https://sourceforge.net/tracker/?func=detail&aid=3132056&group_id=5616&atid=305616

nommu systems cannot fork() as the hardware cannot support
it. irattach uses it as a minor optimization, but it isnt
necessary for correct functioning of the utility. so add a
NO_FORK define so we nommu peeps can do CFLAGS="... -DNO_FORK=1
..." and use it in our embedded systems.

--- a/irattach/irattach.c
+++ b/irattach/irattach.c
@@ -397,7 +397,11 @@
 					after_names[i]);
 				/* Create a new instance for this other
 				 * interface */
+#ifdef NO_FORK
+				pid = -1;
+#else
 				pid = fork();
+#endif
 				/* If in the child */
 				if(!pid) {
 					/* Get the interface name */
+23 −0
Original line number Diff line number Diff line
written by Mike Frysinger

https://sourceforge.net/tracker/?func=detail&aid=3132051&group_id=5616&atid=305616

The top level makefile ignores build/install errors in subdirs which makes
packaging a pain to verify.

--- a/Makefile
+++ b/Makefile
@@ -31,11 +31,11 @@
 CFLAGS= -O2 -W -Wall
 
 all:
-	@-(set -e ; for d in $(DIRS) ; do $(MAKE) $(MAKE_OUTPUT) -C $$d $@ ; done)
+	@(set -e ; for d in $(DIRS) ; do $(MAKE) $(MAKE_OUTPUT) -C $$d $@ ; done)
 
 
 install:
-	@-(set -e ; for d in $(DIRS) ; do $(MAKE) $(MAKE_OUTPUT) -C $$d $@ ; done)
+	@(set -e ; for d in $(DIRS) ; do $(MAKE) $(MAKE_OUTPUT) -C $$d $@ ; done)
 
 
 clean:
Loading