From: Danny Al-Gaaf Date: Tue, 27 Nov 2012 15:54:40 +0000 (+0100) Subject: fix syncfs handling in error case X-Git-Tag: v0.55~41 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4bc3729fd99c4d4dbda9ce7b42c812d75d28c5d;p=ceph.git fix syncfs handling in error case If the call to syncfs() fails, don't try to call syncfs again via syscall(). If HAVE_SYS_SYNCFS is defined, don't fall through to try syscall() with SYS_syncfs or __NR_syncfs. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/common/sync_filesystem.h b/src/common/sync_filesystem.h index 5b23576ff4cd..eff18d20af0f 100644 --- a/src/common/sync_filesystem.h +++ b/src/common/sync_filesystem.h @@ -34,14 +34,10 @@ inline int sync_filesystem(int fd) #ifdef HAVE_SYS_SYNCFS if (syncfs(fd) == 0) return 0; -#endif - -#ifdef SYS_syncfs +#elif defined(SYS_syncfs) if (syscall(SYS_syncfs, fd) == 0) return 0; -#endif - -#ifdef __NR_syncfs +#elif defined(__NR_syncfs) if (syscall(__NR_syncfs, fd) == 0) return 0; #endif