floppym     15/07/19 22:15:13

  Added:                0.21-initializer.patch
  Log:
  Fix build failure, bug 555384.
  
  (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 
0BBEEA1FEA4843A4)

Revision  Changes    Path
1.1                  sys-libs/efivar/files/0.21-initializer.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/efivar/files/0.21-initializer.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-libs/efivar/files/0.21-initializer.patch?rev=1.1&content-type=text/plain

Index: 0.21-initializer.patch
===================================================================
>From a3606c02fd271d32e364fcc540e34ba1899309f6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjo...@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 <pjo...@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.4.6





Reply via email to