Blame irssi-0.8.18.local.patch

Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
--- irssi-0.8.18/build-aux/config.sub.orig	2016-02-08 20:16:25.000000000 +0000
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
+++ irssi-0.8.18/build-aux/config.sub	2016-03-06 18:06:18.154558135 +0000
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
@@ -804,6 +804,10 @@
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	microblaze*)
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 		basic_machine=microblaze-xilinx
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 		;;
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
+	midipix)
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
+		basic_machine=x86_64-pc
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
+		os=-midipix
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
+		;;
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	mingw64)
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 		basic_machine=x86_64-pc
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 		os=-mingw64
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
@@ -1384,7 +1388,7 @@
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	      | -chorusos* | -chorusrdb* | -cegcc* \
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
-	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
+	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
Lucio Andrés Illanes Albornoz (arab, vxp) 95bf77
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
--- irssi-0.8.18/src/core/servers.c.orig	2016-01-20 22:08:07.000000000 +0000
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+++ irssi-0.8.18/src/core/servers.c	2016-06-13 11:28:49.187797037 +0000
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
@@ -407,6 +407,36 @@
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 		/* connect with unix socket */
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 		server_real_connect(server, NULL, server->connrec->address);
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 	} else {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+	#ifdef __midipix__
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		IPADDR ip4, ip6, *ip;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		connect_address = server->connrec->proxy != NULL ?
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			server->connrec->proxy : server->connrec->address;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		if (net_gethostbyname(connect_address, &ip4, &ip6) == -1) {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			g_warning("net_gethostbyname(): -1");
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			g_free(server->tag);
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			g_free(server->nick);
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			return FALSE;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		} else if (server->connrec->family == 0) {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			/* prefer IPv4 addresses */
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			ip = ip4.family != 0 ? &ip4 : &ip6;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		} else if (server->connrec->family == AF_INET6) {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			/* IPv6 address, use if possible */
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			if (ip6.family != 0) {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+				ip = &ip6;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			} else {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+				ip = &ip4;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			}
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		} else {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			/* IPv4 address, use if possible */
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			if (ip4.family != 0) {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+				ip = &ip4;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			} else {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+				ip = &ip6;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+			}
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		}
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+		server_real_connect(server, ip, NULL);
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+	#else
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 		/* resolve host name */
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 		if (pipe(fd) != 0) {
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 			g_warning("server_connect(): pipe() failed.");
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
@@ -433,6 +463,7 @@
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 		lookup_servers = g_slist_append(lookup_servers, server);
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 		signal_emit("server looking", 1, server);
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
+	#endif
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 	}
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 	return TRUE;
Lucio Andrés Illanes Albornoz (arab, vxp) 792796
 }
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
--- irssi-0.8.18/src/core/network.c.orig	2016-02-08 21:20:37.000000000 +0100
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+++ irssi-0.8.18/src/core/network.c	2016-06-17 16:34:16.870746400 +0200
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
@@ -572,9 +572,13 @@
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	int data;
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	socklen_t len = sizeof(data);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#ifndef __midipix__
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	if (getsockopt(g_io_channel_unix_get_fd(handle),
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 		       SOL_SOCKET, SO_ERROR, (void *) &data, &len) == -1)
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 		return -1;
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#else
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+	data = 0;
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#endif
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	return data;
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 }
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
--- irssi-0.8.18/src/core/pidwait.c.orig	2014-09-02 11:13:51.000000000 +0200
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+++ irssi-0.8.18/src/core/pidwait.c	2016-06-19 00:20:33.327763200 +0200
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
@@ -39,8 +39,10 @@
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 void pidwait_add(int pid)
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 {
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	if (g_hash_table_lookup(child_pids, GINT_TO_POINTER(pid)) == NULL) {
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#ifndef __midipix__
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 		int id = g_child_watch_add_full(10, pid, sig_child, NULL, NULL);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 		g_hash_table_insert(child_pids, GINT_TO_POINTER(pid), GINT_TO_POINTER(id));
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#endif
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 		pids = g_slist_append(pids, GINT_TO_POINTER(pid));
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	}
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 }
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
--- irssi-0.8.18/src/fe-common/core/fe-exec.c.orig	2016-01-20 23:08:07.000000000 +0100
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+++ irssi-0.8.18/src/fe-common/core/fe-exec.c	2016-06-19 01:22:40.792090300 +0200
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
@@ -288,6 +288,9 @@
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	}
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 }
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#ifdef __midipix__
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+static void sig_pidwait(void *pid, void *statusp);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#endif
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 static void process_exec(PROCESS_REC *rec, const char *cmd)
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 {
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	const char *shell_args[4] = { "/bin/sh", "-c", NULL, NULL };
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
@@ -535,6 +538,14 @@
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 				    (GInputFunction) sig_exec_input_reader,
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 				    rec);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	processes = g_slist_append(processes, rec);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#ifdef __midipix__
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+	int status;
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+	waitpid(rec->pid, &status, 0);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+	while (rec->read_tag != -1) {
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+		sig_exec_input_reader(rec);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+	}
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+	sig_pidwait((void *)rec->pid, &status);
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
+#endif
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 	if (rec->target == NULL && interactive)
Lucio Andrés Illanes Albornoz (arab, vxp) e6cae1
 		rec->target_item = exec_wi_create(active_win, rec);