Package: gkrellm
Version: 2.3.2-4
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu karmic ubuntu-patch

In Ubuntu, we've applied the attached patch to achieve the following:

  * 07_getline.patch: rename getline() to avoid name conflict (LP: #440870)

We thought you might be interested in doing the same.

From the build log:  

cc -Wall -O2 -I.. -I../shared `pkg-config --cflags gtk+-2.0 gthread-2.0`   
-DGKRELLM_CLIENT -DENABLE_NLS -DLOCALEDIR=\"/usr/share/locale\" -g -O2 -g -Wall 
-O2   -c -o client.o client.c
client.c:1623: error: conflicting types for 'getline'
/usr/include/stdio.h:651: note: previous declaration of 'getline' was here

http://launchpadlibrarian.net/31810451/buildlog_ubuntu-karmic-i386.gkrellm_2.3.2-4ubuntu1_FAILEDTOBUILD.txt.gz

The problem is that getline() is defined in stdio.h in new libc, 
creating conflict with the function defined in gkrellm.

-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic
  APT policy: (500, 'karmic')
Architecture: i386 (i686)

Kernel: Linux 2.6.28-15-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
diff -u gkrellm-2.3.2/debian/patches/series gkrellm-2.3.2/debian/patches/series
--- gkrellm-2.3.2/debian/patches/series
+++ gkrellm-2.3.2/debian/patches/series
@@ -4,0 +5 @@
+07_getline.patch
only in patch2:
unchanged:
--- gkrellm-2.3.2.orig/debian/patches/07_getline.patch
+++ gkrellm-2.3.2/debian/patches/07_getline.patch
@@ -0,0 +1,33 @@
+Author: Ilya Barygin <bary...@gmail.com>
+Description: rename getline() so that in doesn't conflict with the one defined in stdio.h
+Index: gkrellm-2.3.2/src/client.c
+===================================================================
+--- gkrellm-2.3.2.orig/src/client.c	2009-10-02 16:49:13.000000000 +0400
++++ gkrellm-2.3.2/src/client.c	2009-10-02 16:49:15.000000000 +0400
+@@ -1620,7 +1620,7 @@
+ 
+ 
+ static gint
+-getline(gint fd, gchar *buf, gint len)
++get_line(gint fd, gchar *buf, gint len)
+ 	{
+ 	fd_set			read_fds;
+ 	struct timeval	tv;
+@@ -1714,7 +1714,7 @@
+ 
+ 	while (1)
+ 		{
+-		rs=getline(fd, buf, sizeof(buf));
++		rs=get_line(fd, buf, sizeof(buf));
+         if(rs<0)
+             return FALSE;
+ 		if (!strcmp(buf, "</gkrellmd_setup>"))
+@@ -1732,7 +1732,7 @@
+ 	table_size = sizeof(update_table) / sizeof(KeyTable);
+ 	while (1)
+ 		{
+-		rs=getline(fd, buf, sizeof(buf));
++		rs=get_line(fd, buf, sizeof(buf));
+         if(rs<0)
+             return FALSE;
+ 		if (!strcmp(buf, "</initial_update>"))

Reply via email to