Conan_Kudo / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame irssi-0.8.18.local.patch

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) 59398c
--- irssi-0.8.18/src/core/network.c.orig	2016-02-08 21:20:37.000000000 +0100
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
+++ irssi-0.8.18/src/core/network.c	2016-06-17 16:34:16.870746400 +0200
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
@@ -572,9 +572,13 @@
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 	int data;
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 	socklen_t len = sizeof(data);
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
+#ifndef __midipix__
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 	if (getsockopt(g_io_channel_unix_get_fd(handle),
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 		       SOL_SOCKET, SO_ERROR, (void *) &data, &len) == -1)
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 		return -1;
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
+#else
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
+	data = 0;
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
+#endif
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 	return data;
Lucio Andrés Illanes Albornoz (arab, vxp) 59398c
 }
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);