Modify

#429 closed defect (fixed)

[patch] Bitlbee 1.2.1 breaks glib 2.4 compatibility, uses g_file_test() from glib 2.8

Reported by: robert@… Owned by:
Priority: normal Milestone: 1.2.2
Component: BitlBee Version: 1.2.1
Keywords: Cc:
IRC client+version: Client-independent Operating System: Linux
OS version/distro: Red Hat Enterprise Linux 4

Description

I'm the Fedora EPEL maintainer of bitlbee and RHEL 4 (CentOS 4) has glib 2.4.7, which doesn't work with bitlbee 1.2.1 any longer:

glib/gstdio.h: No such file or directory
storage_xml.c: In function `xml_init':
storage_xml.c:248: warning: implicit declaration of function `g_access'

The attached patch solves the problem for me. As far as I got, g_access() is only required for Windows compatibility or porting things. So if no g_access() exists, access() can be used further on in most cases AKA Linux. Was broken with Changeset #385 by Jelmer Vernooij.

Attachments (2)

bitlbee-1.2.1-g_access (1.8 KB) - added by robert@… at 2008-06-29T10:23:19Z.
bitlbee-1.2.1-g_access.patch
bitlbee-1.2.1-g_access.patch (943 bytes) - added by robert@… at 2008-06-29T10:55:31Z.
bitlbee-1.2.1-g_access.patch

Download all attachments as: .zip

Change History (13)

Changed at 2008-06-29T10:23:19Z by robert@…

Attachment: bitlbee-1.2.1-g_access added

bitlbee-1.2.1-g_access.patch

comment:1 Changed at 2008-06-29T10:25:18Z by Wilmer van der Gaast <wilmer@…>

#429: [patch] Bitlbee 1.2.1 breaks glib 2.4 compatibility, uses g_file_test()
from glib 2.8

storage_xml.c: In function `xml_init':
storage_xml.c:248: warning: implicit declaration of function `g_access'

So is g_access() the problem or g_file_test()? Jelmer assured me that
g_file_test() works in GLib 2.4, and indeed I don't see any clear sign
that it doesn't, it's only g_access() that sucks. I asked Jelmer what's
the difference between the two. I expect that just using g_file_test()
everywhere should solve this problem.

comment:2 Changed at 2008-06-29T10:55:08Z by robert@…

Sorry, my failure. It's only g_access() which makes the problem with glib 2.4. I didn't have a correct look to it.

* Compiling storage_xml.c
storage_xml.c:31:25:

glib/gstdio.h: No such file or directory
storage_xml.c: In function `xml_init':
storage_xml.c:248: warning: implicit declaration of function `g_access'
make: *** [storage_xml.o] Error 1

Changed at 2008-06-29T10:55:31Z by robert@…

bitlbee-1.2.1-g_access.patch

comment:3 Changed at 2008-06-29T12:12:58Z by robert@…

http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#GFileTest - there's no check for testing writeable with g_file_test() or am I wrong?

comment:4 Changed at 2008-06-29T23:48:13Z by wilmer

Resolution: fixed
Status: newclosed

Yup, Jelmer just told me that too. I submitted his fix, and altered the code to just use g_access() everywhere (I find using both that and g_file_test() a little bit messy). Jelmer's fix adds a #define g_access access, which should work well enough.

changeset:devel,408

comment:5 Changed at 2008-06-30T20:48:48Z by robert@…

Resolution: fixed
Status: closedreopened

We are still missing the conditional include, because the file does not exist in old versions (see comments above). And shouldn't we define F_OK again as in the past, if it is maybe not defined?! But in the past, the F_OK was defined in another file, see the link above. Note, that my diff is against Bitlbee 1.2.1, not against current changesets. But should be easily understandable as well.

--- bitlbee-1.2.1/storage_xml.c           2008-06-10 01:09:06.000000000 +0200
+++ bitlbee-1.2.1/storage_xml.c.gaccess   2008-06-30 22:45:33.000000000 +0200
@@ -28,8 +28,18 @@
 #include "base64.h"
 #include "arc.h"
 #include "md5.h"
+
+#if !GLIB_CHECK_VERSION(2,8,0)
 #include <glib/gstdio.h>

+/* GLib < 2.8.0 doesn't have g_access, so just use the system access(). */
+#define g_access access
+
+#ifndef F_OK
+#define F_OK 0
+#endif
+#endif
+
 typedef enum
 {
        XML_PASS_CHECK_ONLY = -1,

comment:6 Changed at 2008-07-07T18:08:29Z by robert@…

Once upstream currently seems to be unable to provide a fully working solution, the following (working) patch went into Fedora and EPEL:

http://cvs.fedoraproject.org/viewcvs/*checkout*/devel/bitlbee/bitlbee-1.2.1-gaccess.patch

comment:7 Changed at 2008-08-24T16:46:41Z by wilmer

Resolution: fixed
Status: reopenedclosed

This really should be fixed now.

changeset:devel,418.

comment:8 Changed at 2008-08-27T21:32:55Z by robert@…

No, no, no, Wilmer, no. This is still not fixed, unluckily. It still fails in RHEL 4.x once more. But all good things are three, right? So you've got a third try now - maybe fixed for Bitlbee 1.2.3? You know, I'm just kidding... ;-)

Once this is covered by upstream, the following (working) patch went into Fedora and EPEL:

http://cvs.fedoraproject.org/viewcvs/*checkout*/devel/bitlbee/bitlbee-1.2.2-gaccess.patch

comment:9 Changed at 2008-08-27T22:12:19Z by wilmer

Resolution: fixed
Status: closedreopened

comment:10 Changed at 2008-09-07T20:19:06Z by robert@…

Fixed with Bitlbee 1.2.3 now - can somebody please look for the correct changeset and add it here and close then? Looks like I'm somehow not allowed to close.

comment:11 Changed at 2008-09-11T08:22:41Z by wilmer

Resolution: fixed
Status: reopenedclosed

changeset:devel,443 and changeset:devel,tag:1.2.3 (I doubt if Trac supports that syntax, though.)

Yeah, sorry, those controls are closed since spammers liked to mess with them.

Modify Ticket

Action
as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.