Bug 67075 - Compilation broken on linux 2.6 - unknown type name 'sa_family_t'
Summary: Compilation broken on linux 2.6 - unknown type name 'sa_family_t'
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-19 09:46 UTC by Jesper Larsen
Modified: 2013-07-19 12:29 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch (974 bytes, text/plain)
2013-07-19 09:46 UTC, Jesper Larsen
Details

Description Jesper Larsen 2013-07-19 09:46:49 UTC
Created attachment 82673 [details]
Patch

The following commit breaks compilation with Linux kernel headers from 2.6.37.

http://cgit.freedesktop.org/systemd/systemd/commit/?id=2e996f4d4b642c5682c608c9692ad2ffae398ab2

Compilation breaks with the output

In file included from src/nspawn/nspawn.c:42:0: /usr/include/linux/netlink.h:31:2: error: unknown type name 'sa_family_t'

linux/netlink.h includes linux/socket.h for sa_family_t, but it is protected by a #ifdef __KERNEL__

Newer kernels have fixed this issue such that linux/netlink.h is self contained.

A work around is to include linux/netlink.h after sys/socket.h

I have attached a patch that does this, and verified that it fixes compilation on the 2.6.37 kernel.
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-07-19 12:29:11 UTC
Applied in http://cgit.freedesktop.org/systemd/systemd/commit/?id=aea38d8.

Normally we wouldn't care about unsupported kernels, but since this just reorders two lines, I don't see why not to apply it.


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.