From f8620d627a59414b3a63c28f245201f4dd273880 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 28 Nov 2008 13:07:08 +0100 Subject: [PATCH] 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. --- fd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); -- 2.39.2