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 <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2012-11-27 16:54:40 +01:00 committed by Sage Weil
parent 16215d9ca8
commit d4bc3729fd

View File

@ -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