Package: gnoemoe
Version: 2.2.0+dfsg-2.1
Severity: important
Tags: patch
Justification: fails to build from source
User: [email protected]
Usertags: origin-ubuntu karmic ubuntu-patch



*** /tmp/tmpSXFSVT
In Ubuntu, we've applied the attached patch to achieve the following:

  * Fix FTBFS with GCC 4.4 (LP: #459164) 

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 
'karmic-proposed'), (500, 'karmic-backports'), (500, 'karmic')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-14-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- gnoemoe-2.2.0+dfsg.orig/debian/patches/10_fix_ftbfs_gcc_44.diff
+++ gnoemoe-2.2.0+dfsg/debian/patches/10_fix_ftbfs_gcc_44.diff
@@ -0,0 +1,46 @@
+#
+# Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnoemoe/+bug/459164
+# Description: Fix FTBFS with GCC 4.4.
+#
+diff -Nur -x '*.orig' -x '*~' fixes-bug-459164/gnoemoe/gm-world.c fixes-bug-459164.new/gnoemoe/gm-world.c
+--- fixes-bug-459164/gnoemoe/gm-world.c	2009-10-23 17:35:53.792034712 +0200
++++ fixes-bug-459164.new/gnoemoe/gm-world.c	2009-10-26 16:49:42.049732603 +0100
+@@ -736,6 +736,8 @@
+ 	struct tm *timet;
+ 	time_t timer;
+ 	gint len;
++	gint total_written = 0;
++	gint written = 0;
+ 	GmOptions *options;
+ 	
+ 	if (type == LOG_NONE) {
+@@ -816,10 +818,27 @@
+ 	no_ansi = gm_ansi_strip(g_strdup(s->str));
+ 	len = strlen(no_ansi);
+ 
+-	write(world->priv->fd_log, no_ansi, strlen(no_ansi));	
++	do {
++		gint count = (len - total_written);
++		written = write(world->priv->fd_log, (no_ansi + total_written), count);
++		if (written > 0)
++			total_written += written;
++		if (written == count)
++			break;
++	} while (written >= 0 || errno == EINTR);
++	if (written < 0) {
++		gm_debug_msg(DEBUG_DEFAULT, "GmWorld.Log: couldn't write "
++				"log: %s", strerror(errno));
++	}
+ 	
+ 	if (no_ansi[len - 1] != '\n') {
+-		write(world->priv->fd_log, "\n", 1);
++		do {
++			written = write(world->priv->fd_log, "\n", 1);
++		} while (written < 0 && errno == EINTR);
++		if (written != 1) {
++			gm_debug_msg(DEBUG_DEFAULT, "GmWorld.Log: couldn't write "
++					"log: %s", strerror(errno));
++		}
+ 	}
+ 	
+ 	g_free(no_ansi);

Reply via email to