All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] efivar: fix zero initializer compiler error
@ 2016-01-19 10:45 Alexandru But
  2016-01-29 18:01 ` Martin Jansa
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandru But @ 2016-01-19 10:45 UTC (permalink / raw)
  To: openembedded-devel

Patch based on commit a3606c0:
Sometimes the compiler doesn't like { 0,} as an initializer

Signed-off-by: Alexandru But <alexandru.but@ni.com>
---
 ...he-compiler-doesn-t-like-0-as-an-initiali.patch | 42 ++++++++++++++++++++++
 meta-oe/recipes-extended/efivar/efivar_0.21.bb     |  3 +-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch

diff --git a/meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch b/meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch
new file mode 100644
index 0000000..68cabd6
--- /dev/null
+++ b/meta-oe/recipes-extended/efivar/efivar/0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch
@@ -0,0 +1,42 @@
+From a3606c02fd271d32e364fcc540e34ba1899309f6 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@redhat.com>
+Date: Tue, 14 Jul 2015 09:33:54 -0400
+Subject: [PATCH] Sometimes the compiler doesn't like { 0, } as an
+ initializer...
+
+Because it really wants to be { {0, },} or something, and sometimes the
+compiler, knowing full well what we're trying to do, likes to complain
+about the rigor applied to our technique in doing it.
+
+memset() the struct ifreq to 0 instead so I don't need to figure out its
+internal structure just to zero it out.
+
+Resolves #28
+
+Signed-off-by: Peter Jones <pjones@redhat.com>
+---
+ src/linux.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/linux.c b/src/linux.c
+index 57f71f3..817b8e6 100644
+--- a/src/linux.c
++++ b/src/linux.c
+@@ -847,12 +847,13 @@ ssize_t
+ __attribute__((__visibility__ ("hidden")))
+ make_mac_path(uint8_t *buf, ssize_t size, const char * const ifname)
+ {
+-	struct ifreq ifr = { 0, };
++	struct ifreq ifr;
+ 	struct ethtool_drvinfo drvinfo = { 0, };
+ 	int fd, rc;
+ 	ssize_t ret = -1, sz, off=0;
+ 	char busname[PATH_MAX+1] = "";
+ 
++	memset(&ifr, 0, sizeof (ifr));
+ 	strncpy(ifr.ifr_name, ifname, IF_NAMESIZE);
+ 	drvinfo.cmd = ETHTOOL_GDRVINFO;
+ 	ifr.ifr_data = (caddr_t)&drvinfo;
+-- 
+2.6.1
+
diff --git a/meta-oe/recipes-extended/efivar/efivar_0.21.bb b/meta-oe/recipes-extended/efivar/efivar_0.21.bb
index b5ef90a..1684a10 100644
--- a/meta-oe/recipes-extended/efivar/efivar_0.21.bb
+++ b/meta-oe/recipes-extended/efivar/efivar_0.21.bb
@@ -8,7 +8,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393"
 DEPENDS_class-target = "popt efivar-native"
 
 SRCREV = "aab6c2a64d90b6e5a63661fb5bd6be8d878b0784"
-SRC_URI = "git://github.com/rhinstaller/efivar.git"
+SRC_URI = "git://github.com/rhinstaller/efivar.git \
+           file://0001-Sometimes-the-compiler-doesn-t-like-0-as-an-initiali.patch"
 SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch"
 SRC_URI_append_class-native = " file://efivar-drop-options-not-supported-by-lower-version-gcc.patch"
 
-- 
2.6.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-01 18:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19 10:45 [meta-oe][PATCH] efivar: fix zero initializer compiler error Alexandru But
2016-01-29 18:01 ` Martin Jansa
2016-02-01  9:24   ` Alexandru But
2016-02-01 10:45     ` linux-yocto issues Was: " Martin Jansa
2016-02-01 10:45       ` linux-yocto issues Was: [oe] " Martin Jansa
2016-02-01 13:33       ` [OE-core] linux-yocto issues Was: " Bruce Ashfield
2016-02-01 13:33         ` linux-yocto issues Was: [oe] " Bruce Ashfield
2016-02-01 18:46     ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.