]> git.tuebingen.mpg.de Git - osl.git/commitdiff
Silence a gcc warning.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 6 Jan 2015 17:32:58 +0000 (18:32 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 18 Feb 2015 14:11:30 +0000 (15:11 +0100)
Unfortunately, casting the return value to void is not enough to make
the warning go away, at least on Ubuntu systems.

fsck.c

diff --git a/fsck.c b/fsck.c
index ce8f1dc704c6c335f356233284a85093b11ddcad..9701f277a60f6bd503e7600489d4b90b10779704 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -279,9 +279,10 @@ static int fsck_opendir(const char *dirname, DIR **dir, int *cwd)
        if (*dir)
                return 1;
        ret = errno == EACCES? -E_FSCK_ACCESS : -E_FSCK_OPENDIR;
-/* Ignore return value of fchdir() and close(). We're busted anyway. */
-       if (cwd)
-               fchdir(*cwd);
+       /* Ignore return value of fchdir() and close(). We're busted anyway. */
+       if (cwd) {
+               int __a_unused ret2 = fchdir(*cwd); /* STFU, gcc */
+       }
 close_cwd:
        if (cwd)
                close(*cwd);