[PATCH] doc: watchdog simple example: don't fail on fsync()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Giel van Schijndel
Date: Monday, March 22, 2010 - 5:22 am

Don't terminate the watchdog daemon when fsync() fails because no
watchdog driver actually implements the fsync() syscall.
---
 Documentation/watchdog/src/watchdog-simple.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Documentation/watchdog/src/watchdog-simple.c b/Documentation/watchdog/src/watchdog-simple.c
index 4cf72f3..cd6d0dd 100644
--- a/Documentation/watchdog/src/watchdog-simple.c
+++ b/Documentation/watchdog/src/watchdog-simple.c
@@ -1,3 +1,4 @@
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -18,7 +19,9 @@ int main(void)
 			break;
 		}
 		ret = fsync(fd);
-		if (ret)
+		if (ret
+		 && errno != EINVAL
+		 && errno != ENOSYS)
 			break;
 		sleep(10);
 	}
-- 
1.6.4.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] doc: watchdog simple example: don't fail on fsync(), Giel van Schijndel, (Mon Mar 22, 5:22 am)
Re: [PATCH] doc: watchdog simple example: don't fail on fs ..., Giel van Schijndel, (Wed Mar 24, 2:04 am)
Re: [PATCH] doc: watchdog simple example: don't fail on fs ..., Wim Van Sebroeck, (Mon Mar 29, 11:40 am)
Re: [PATCH] doc: watchdog simple example: don't fail on fs ..., Giel van Schijndel, (Mon Mar 29, 12:12 pm)