From: Andre Noll Date: Fri, 28 Nov 2008 12:07:08 +0000 (+0100) Subject: Get rid of a gcc warning on recent Ubuntu systems. X-Git-Tag: v0.3.3~13^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f8620d627a59414b3a63c28f245201f4dd273880 Get rid of a gcc warning on recent Ubuntu systems. fchdir() is marked with warn_unused_result which produces a warning in the error path of para_opendir(). However, we really want to ignore the return value in this particular case, so introduce a rather ugly fix to avoid the warning. --- diff --git a/fd.c b/fd.c index 58851723..d0b5c895 100644 --- a/fd.c +++ b/fd.c @@ -285,9 +285,10 @@ int para_opendir(const char *dirname, DIR **dir, int *cwd) if (*dir) return 1; ret = -ERRNO_TO_PARA_ERROR(errno); -/* 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);