Bug 23093 - [PATCH] Add FreeBSD portability fixes to polkit
Summary: [PATCH] Add FreeBSD portability fixes to polkit
Status: RESOLVED FIXED
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: libpolkit (show other bugs)
Version: unspecified
Hardware: All FreeBSD
: medium major
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-02 12:40 UTC by Joe Marcus Clarke
Modified: 2009-08-12 07:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fix portability issues on FreeBSD (13.88 KB, patch)
2009-08-02 12:40 UTC, Joe Marcus Clarke
Details | Splinter Review

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.