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

Andreas Kohn andreas.kohn@gmx.net
Wed, 17 Jul 2002 13:09:13 +0200


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.

The following patch should fix that, but I didn't know where to send it.

This is my first patch ever to a open source project, so could you give me
some hints
on how to do it "The Right Way(tm)"?

Could someone test this patch for correctness and apply it if neccessary?

----patch---
--- daemon-messages.c.org Wed Jul 17 12:27:47 2002
+++ daemon-messages.c Wed Jul 17 13:05:52 2002
@@ -17,6 +17,10 @@
 #include <signal.h>
 #endif

+#ifndef iovec
+#include <sys/uio.h>
+#endif
+
 #include <mono/io-layer/wapi.h>
 #include <mono/io-layer/daemon-messages.h>

@@ -147,6 +151,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;
@@ -157,16 +164,12 @@
  msg.msg_flags=0;
  iov.iov_base=req;
  iov.iov_len=sizeof(WapiHandleRequest);
-
-#ifndef HAVE_MSG_NOSIGNAL
- void (*old_sigpipe)(int);
-#endif

 #ifdef HAVE_MSG_NOSIGNAL
  ret=recvmsg (fd, &msg, MSG_NOSIGNAL);
 #else
  old_sigpipe = signal (SIGPIPE, SIG_IGN);
- ret=recvmsg (fd, &msg, MSG_NOSIGNAL);
+ ret=recvmsg (fd, &msg, 0);
  signal (SIGPIPE, old_sigpipe);
 #endif
  if(ret==-1 || ret!= sizeof(WapiHandleRequest)) {

----end-----

Regards,
Andreas Kohn.