Package: netplug
Severity: minor
Usertags: clang-ftbfs
User: pkg-llvm-t...@lists.alioth.debian.org
Tag: patch


Hello,

Using the rebuild infrastructure, your package fails to build with clang
(instead of gcc).

Thanks,
Arthur
iff -Naur netplug.orig/netplug-1.2.9.2/debian/changelog netplug/netplug-1.2.9.2/debian/changelog
--- netplug.orig/netplug-1.2.9.2/debian/changelog	2014-06-06 17:02:12.883622005 -0500
+++ netplug/netplug-1.2.9.2/debian/changelog	2014-06-06 17:21:01.395641658 -0500
@@ -1,3 +1,12 @@
+netplug (1.2.9.2-2) unstable; urgency=low
+
+  * Fix FTBFS with clang:
+    - Fixed "function declaration not allowed" in
+      if_info.c
+      main.c
+
+ -- Arthur Marble <art...@info9.net>  Fri, 06 Jun 2014 17:21:01 -0500
+
 netplug (1.2.9.2-1) unstable; urgency=low
 
   * New upstream version:
diff -Naur netplug.orig/netplug-1.2.9.2/debian/patches/clang-ftbfs.diff netplug/netplug-1.2.9.2/debian/patches/clang-ftbfs.diff 
--- netplug.orig/netplug-1.2.9.2/debian/patches/clang-ftbfs.diff	1969-12-31 18:00:00.000000000 -0600
+++ netplug/netplug-1.2.9.2/debian/patches/clang-ftbfs.diff	2014-06-06 17:23:16.311644007 -0500
@@ -0,0 +1,111 @@
+--- a/if_info.c
++++ b/if_info.c
+@@ -284,6 +284,14 @@ ifsm_flagchange(struct if_info *info, un
+     info->lastchange = time(0);
+ }
+ 
++int find_pid(struct if_info *i, pid_t pid, struct if_info *info) {
++    if (i->worker == pid) {
++        info = i;
++        return 1;
++    }
++    return 0;
++}
++
+ /* handle a script termination and update the state accordingly */
+ void ifsm_scriptdone(pid_t pid, int exitstatus)
+ {
+@@ -291,14 +299,6 @@ void ifsm_scriptdone(pid_t pid, int exit
+     struct if_info *info;
+     assert(WIFEXITED(exitstatus) || WIFSIGNALED(exitstatus));
+ 
+-    int find_pid(struct if_info *i) {
+-        if (i->worker == pid) {
+-            info = i;
+-            return 1;
+-        }
+-        return 0;
+-    }
+-
+     info = NULL;
+     for_each_iface(find_pid);
+ 
+--- a/main.c
++++ b/main.c
+@@ -173,6 +173,23 @@ child_handler(int sig, siginfo_t *info,
+     }
+ }
+ 
++static int pollflags(struct if_info *info, int sockfd) {
++    struct ifreq ifr;
++
++    if (!if_match(info->name))
++        return 0;
++
++    memcpy(ifr.ifr_name, info->name, sizeof(ifr.ifr_name));
++    if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0)
++        do_log(LOG_ERR, "%s: can't get flags: %m", info->name);
++    else {
++        ifsm_flagchange(info, ifr.ifr_flags);
++        ifsm_flagpoll(info);
++    }
++
++    return 0;
++}
++
+ /* Poll the existing interface state, so we can catch any state
+    changes for which we may not have neen a netlink message. */
+ static void
+@@ -189,28 +206,20 @@ poll_interfaces(void)
+         close_on_exec(sockfd);
+     }
+ 
+-    int pollflags(struct if_info *info) {
+-        struct ifreq ifr;
+-
+-        if (!if_match(info->name))
+-            return 0;
+-
+-        memcpy(ifr.ifr_name, info->name, sizeof(ifr.ifr_name));
+-        if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0)
+-            do_log(LOG_ERR, "%s: can't get flags: %m", info->name);
+-        else {
+-            ifsm_flagchange(info, ifr.ifr_flags);
+-            ifsm_flagpoll(info);
+-        }
+-
+-        return 0;
+-    }
+-
+     for_each_iface(pollflags);
+ }
+ 
+ int debug = 0;
+ 
++/* Run over each of the interfaces we know and care about, and
++   make sure the state machine has done the appropriate thing
++   for their current state. */
++static int poll_flags(struct if_info *i) {
++    if (if_match(i->name))
++	ifsm_flagpoll(i);
++    return 0;
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+@@ -341,14 +350,6 @@ main(int argc, char *argv[])
+     };
+ 
+     {
+-        /* Run over each of the interfaces we know and care about, and
+-           make sure the state machine has done the appropriate thing
+-           for their current state. */
+-        int poll_flags(struct if_info *i) {
+-            if (if_match(i->name))
+-                ifsm_flagpoll(i);
+-            return 0;
+-        }
+         for_each_iface(poll_flags);
+     }
+ 
diff -Naur netplug.orig/netplug-1.2.9.2/debian/patches/series netplug/netplug-1.2.9.2/debian/patches/series 
--- netplug.orig/netplug-1.2.9.2/debian/patches/series	2014-06-06 17:02:12.883622005 -0500
+++ netplug/netplug-1.2.9.2/debian/patches/series	2014-06-06 17:02:31.951622338 -0500
@@ -2,3 +2,4 @@
 20quoting.patch
 30path.patch
 40callback.patch
+clang-ftbfs.diff

Reply via email to