Skip to contentSkip to conversation

fix syncfs handling in error case

PATCH In review Danny Al-Gaaf 1 participant 2 messages Nov 27, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 use syscall() with SYS_syncfs.

---
 src/common/sync_filesystem.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
src/common/sync_filesystem.h +1 -3
index dc90b89..976400f 100644
@@ -34,9 +34,7 @@ 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
Signature · 1 line
1.8.0
#1 lore raw

Hi,

forget this patch, I'll send a new version due to changes in master.

Danny

Am 27.11.2012 16:23, schrieb Danny Al-Gaaf:

Quoted 25 lines

If the call to syncfs() fails, don't try to call syncfs again via syscall(). If HAVE_SYS_SYNCFS is defined, don't use syscall() with SYS_syncfs.

---
 src/common/sync_filesystem.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
src/common/sync_filesystem.h +1 -3
index dc90b89..976400f 100644
@@ -34,9 +34,7 @@ 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