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

Andreas Kohn andreas.kohn@gmx.net
Wed, 17 Jul 2002 21:05:19 +0200


> On Wed, 2002-07-17 at 12:09, Andreas Kohn wrote:
> > Hello!
> >
> > I tried to compile mono under FreeBSD 4.6-Release, and gcc didn't want
to
> > compile
> > mono/io-layer/daemon-messages.c because
> > -struct iovec was not defined
> > -MSG_NOSIGNAL was not defined.
> >
> > Could someone test this patch for correctness and apply it if
neccessary?
>
> done.
Thanks.

[some terribly wrong patch here]
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)

-----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-----

Regards,
--Andreas.