Bug 23093

Summary: [PATCH] Add FreeBSD portability fixes to polkit
Product: PolicyKit Reporter: Joe Marcus Clarke <marcus>
Component: libpolkitAssignee: David Zeuthen (not reading bugmail) <zeuthen>
Status: RESOLVED FIXED QA Contact: David Zeuthen (not reading bugmail) <zeuthen>
Severity: major    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Fix portability issues on FreeBSD

Description Joe Marcus Clarke 2009-08-02 12:40:29 UTC
Created attachment 28270 [details] [review]
Fix portability issues on FreeBSD

There are a few issues with building polkit-0.93 on FreeBSD:

* No clearenv() function on FreeBSD

* While FreeBSD has a /proc, it is deprecated, and kinfo_proc should be used instead.

* FreeBSD's printf() functions do not support the %m notation.  This is only supported for syslog().

* You can't call GINT_TO_POINTER() on a 64-bit value, as this will break on 64-bit OSes.

The attached patch fixes these problems.  First, a check for clearenv() is added to configure.  Second, I moved the check for process uid to polkit/polkitunixprocess.c.  This may not be ideal, but it seems to fit, and reduces code duplication.  Third, I replaces all %m with %s ... g_strerror (errno).  Finally, I replaced GINT_TO_POINTER() with GSIZE_TO_POINTER.
Comment 1 David Zeuthen (not reading bugmail) 2009-08-12 07:10:08 UTC
Committed, thanks!

http://cgit.freedesktop.org/PolicyKit/commit/?id=de9453f4c178fe76a4a36edb752e2ed75a329032

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.