Unfortunately, casting the return value to void is not enough to make
the warning go away, at least on Ubuntu systems.
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);