[Mono-list] [Patch] mono/io-layer/daemon-messages.c - won'tcompile on FreeBSD 4.6-Release

Dick Porter dick@ximian.com
18 Jul 2002 10:29:52 +0100


On Wed, 2002-07-17 at 20:05, Andreas Kohn wrote:
> I'm very sorry, I somehow mixed my original and changed file, it looks like
> I diff-ed 2 changed versions against each other)
> 
> How do you create patches, and which diff options do you use?
> I used
> diff -u mono/io-layer/daemon-messages.c.org mono/io-layer/daemon-messages.c
> >daemon-messages.diff
> (the .c.org is the file before I started changing, from a fresh checkout
> around 2000 CEST)

If you're checking the files out of CVS, then "cvs diff -u"

> 
> -----patch------------
> --- mono/io-layer/daemon-messages.c.org Wed Jul 17 21:05:23 2002
> +++ mono/io-layer/daemon-messages.c Wed Jul 17 20:35:08 2002
> @@ -149,6 +149,9 @@
>   struct iovec iov;
>   struct cmsghdr *cmsg;
>   guchar cmsgdata[CMSG_SPACE (sizeof(int)*3)];
> +#ifndef HAVE_MSG_NOSIGNAL
> + void (*old_sigpipe)(int);
> +#endif
> 
>   msg.msg_name=NULL;
>   msg.msg_namelen=0;
> @@ -163,7 +166,9 @@
>  #ifdef HAVE_MSG_NOSIGNAL
>   ret=recvmsg (fd, &msg, MSG_NOSIGNAL);
>  #else
> + old_sigpipe = signal (SIGPIPE,SIG_IGN);
>   ret=recvmsg (fd, &msg, 0);
> + signal (SIGPIPE,old_sigpipe);
>  #endif
>   if(ret==-1 || ret!= sizeof(WapiHandleRequest)) {
>    /* Make sure we dont do anything with this response */
> 
> ---------patch end-----

It's not necessary to set the SIGPIPE signal handler in this function,
as the daemon already ignores SIGPIPE.

- Dick