Skip to content

Instantly share code, notes, and snippets.

@jasperla
Created November 1, 2013 11:25
Show Gist options
  • Save jasperla/7264123 to your computer and use it in GitHub Desktop.
Save jasperla/7264123 to your computer and use it in GitHub Desktop.
--- README_PORTING.orig 2013-10-20 11:52:04.000000000 -0200
+++ README_PORTING 2013-10-20 11:52:34.000000000 -0200
@@ -26,7 +26,7 @@ BUILDING MG
So, basic instructions for building mg:
- Get clens installed. I hope someone will build packages for it.
- - Install pmake, the bsd version of make.
+ - Install BSD make (pmake on Linux or bsd_make for Mac OS X brew)
- run the following commands:
pmake
--- sysdef.h.orig 2013-10-20 11:23:01.000000000 -0200
+++ sysdef.h 2013-10-20 11:23:08.000000000 -0200
@@ -15,6 +15,9 @@
# define __USE_GNU
#endif
+#ifdef __APPLE__
+# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
+#endif
#include <stdio.h>
#include <unistd.h>
--- region.c.orig 2013-10-20 11:24:27.000000000 -0200
+++ region.c 2013-10-20 11:25:48.000000000 -0200
@@ -602,7 +602,12 @@ pwriteout(int fd, char **text, int *len)
{
int w;
+/* As per: http://lists.apple.com/archives/macnetworkprog/2002/Dec/msg00091.html */
+#ifdef __APPLE__
+ if (((w = send(fd, *text, *len, SO_NOSIGPIPE)) == -1)) {
+#else
if (((w = send(fd, *text, *len, MSG_NOSIGNAL)) == -1)) {
+#endif
switch(errno) {
case EPIPE:
*len = -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment