Fix building with newer toolchains
authorSteven Barth <steven@midlink.org>
Sun, 13 Apr 2014 16:33:39 +0000 (18:33 +0200)
committerSteven Barth <steven@midlink.org>
Mon, 14 Apr 2014 06:47:22 +0000 (08:47 +0200)
Signed-off-by: Steven Barth <steven@midlink.org>
main.c
utils.c

diff --git a/main.c b/main.c
index bf0830b..bc1cfd7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -479,7 +479,7 @@ int main(int argc, char **argv)
                        break;
 
                case 'q':
-                       freopen("/dev/null", "w", stderr);
+                       if (freopen("/dev/null", "w", stderr)) {}
                        break;
 
                case 'h':
@@ -514,7 +514,7 @@ int main(int argc, char **argv)
 #endif
                }
 
-               freopen("/dev/null", "w", stderr);
+               if (freopen("/dev/null", "w", stderr)) {};
 
                cfg_state->disable_ipsets = true;
                print_family = family;
diff --git a/utils.c b/utils.c
index 7e5ae45..8ed52be 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -697,7 +697,7 @@ fw3_hotplug(bool add, void *zone, void *device)
        close(0);
        close(1);
        close(2);
-       chdir("/");
+       if (chdir("/")) {};
 
        clearenv();
        setenv("ACTION",    add ? "add" : "remove", 1);