Browse Source

util-linux: Updated (2.22.2 -> 2.23.2)

Thanks to Alejandro for providing help and his container_of implementation
taken from sancus-core.

https://github.com/sancus-project/sancus-core/blob/master/include/sancus_common.h
stable/0.6
Christian Wiese 11 years ago committed by Christian Wiese
parent
commit
0e3592bec7
  1. 60
      base/util-linux/0001-replace-container_of.patch
  2. 6
      base/util-linux/util-linux.desc

60
base/util-linux/0001-replace-container_of.patch

@ -0,0 +1,60 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../util-linux/0001-replace-container_of.patch
# Copyright (C) 2013 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
This patch is fixing build issues by using a more simple but reasonable
container_of function without abusing __typeof__.
Besides that it is removing code duplication because the list_entry function
macro is the same as container_of.
Without the patch we are getting following error:
------------------------------------------------------------------------------
sys-utils/prlimit.c: In function 'show_limits':
sys-utils/prlimit.c:299:25: error: expected declaration specifiers or '...' before '(' token
sys-utils/prlimit.c:299:25: error: '__mptr' undeclared (first use in this function)
sys-utils/prlimit.c:299:25: note: each undeclared identifier is reported only once for each function it appears in
sys-utils/prlimit.c: In function 'do_prlimit':
sys-utils/prlimit.c:336:25: error: expected declaration specifiers or '...' before '(' token
sys-utils/prlimit.c:336:25: error: '__mptr' undeclared (first use in this function
------------------------------------------------------------------------------
--- util-linux-2.23.2/include/c.h.orig 2013-08-27 10:32:00.890399403 +0200
+++ util-linux-2.23.2/include/c.h 2013-08-27 10:41:56.872040920 +0200
@@ -115,9 +115,8 @@
#endif
#ifndef container_of
-#define container_of(ptr, type, member) ({ \
- const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+#define container_of(ptr, type, member) \
+ ((type *)((char *)(ptr) - offsetof(type, member)))
#endif
#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
--- util-linux-2.23.2/include/list.h.orig 2013-08-27 10:35:19.025606381 +0200
+++ util-linux-2.23.2/include/list.h 2013-08-27 10:36:09.172435338 +0200
@@ -166,10 +166,7 @@
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*/
-#define list_entry(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
+#define list_entry container_of
#define list_first_entry(head, type, member) \
((head) && (head)->next != (head) ? list_entry((head)->next, type, member) : NULL)

6
base/util-linux/util-linux.desc

@ -2,7 +2,7 @@
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
[COPY]
[COPY] Filename: package/.../util-linux/util-linux.desc
[COPY] Copyright (C) 2008 - 2012 The OpenSDE Project
[COPY] Copyright (C) 2008 - 2013 The OpenSDE Project
[COPY]
[COPY] More information can be found in the files COPYING and README.
[COPY]
@ -33,7 +33,7 @@
[L] GPL
[S] Stable
[V] 2.22.2
[V] 2.23.2
[P] X -1-3-----9 179.200
[D] 1099286102 util-linux-2.22.2.tar.bz2 http://www.kernel.org/pub/linux/utils/util-linux/v2.22/
[D] 1845457113 util-linux-2.23.2.tar.bz2 http://www.kernel.org/pub/linux/utils/util-linux/v2.23/

Loading…
Cancel
Save