Rox Filer unable to compile on NetBSD (propably on OpenBSD too) (patch) (fwd)

Petri Laakso <[email protected]> Tue, 17 Jan 2012 13:49:46 +0200 (EET)
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <[email protected]>
Original post to mailing list bounced back because I was not subscribed,
so here you go:

---------- Forwarded message ----------
Date: Tue, 17 Jan 2012 12:42:25 +0200 (EET)
From: Petri Laakso <[email protected]>
To: [email protected]
Subject: Rox Filer unable to compile on NetBSD (propably on OpenBSD too) (patch)


Hi

I was unable to build Rox Filer on NetBSD i386 from pkgsrc-2011Q4:

xtypes.c: In function 'xattr_init':
xtypes.c:62: error: 'RTLD_NOLOAD' undeclared (first use in this function)
xtypes.c:62: error: (Each undeclared identifier is reported only once
xtypes.c:62: error: for each function it appears in.)
*** Error code 1

I found that NetBSD or OpenBSD does not have RTLD_NOLOAD flag for dlopen,
so I just removed RTLD_NOLOAD's from xtypes.c and live happily after.
Is this correct fix? If this is a correct fix, could it be implemented on
upstream sources also?

Petri

Proposed fix:

demoni$ diff -uN xtypes.c.orig xtypes.c
--- xtypes.c.orig       2009-07-18 17:23:18.000000000 +0300
+++ xtypes.c    2012-01-16 15:30:05.000000000 +0200
@@ -59,11 +59,11 @@
  {
         void *libc;

-       libc = dlopen("libc.so.6", RTLD_LAZY | RTLD_NOLOAD);
+       libc = dlopen("libc.so.6", RTLD_LAZY);
         if (!libc)
         {
                 /* Try a different name for uClib support */
-               libc = dlopen("libc.so", RTLD_LAZY | RTLD_NOLOAD);
+               libc = dlopen("libc.so", RTLD_LAZY);
         }

         if (!libc)

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d