Google
  Web www.spinics.net

Re: [Uclinux-dist-devel] [irda-users] [PATCH] use daemon instead offork in irattach for arch without MMU

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


On Tue 4 Aug 2009 00:03, graff.yang@xxxxxxxxx pondered:
> Hi, sir,
> 
> The following patch makes the irattach can run on some arch, like
> blackfin, that running uClinux because of without MMU.
> 
> Index: irda-utils/irattach/util.c
> ===================================================================
> --- irda-utils/irattach/util.c	(revision 125)
> +++ irda-utils/irattach/util.c	(working copy)
> @@ -156,8 +156,9 @@
>  
>  void fork_now(int ttyfd)
>  {
> +	int i;
> +#ifndef __uClinux__
>  	int ret;
> -	int i;
>  
>  	if ((ret = fork()) > 0)
>  		exit(0);
> @@ -171,6 +172,10 @@
>  		/* cleanup_files = 0; */
>  		exit(0);
>  	}
> +#else
> +	daemon (1, 1);
> +	syslog(LOG_INFO, "run in the background ...");
> +#endif
>  
>  	/* Close all open inherited files! Except for ttyfd! */
>  	for (i = 0; i < 64; i++)
> 

Why not just get rid of the ugly ifdef you added, and just use daemon all the 
time for every system?

It is as common as fork() - and has existed since BSD 4.4 (1995 ish).

-Robin
--
To unsubscribe from this list: send the line "unsubscribe irda-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Home]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux