mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Giel van Schijndel <me@mortis.eu>
To: Wim Van Sebroeck <wim@iguana.be>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] doc: watchdog simple example: don't fail on fsync()
Date: Mon, 29 Mar 2010 21:12:09 +0200	[thread overview]
Message-ID: <20100329191209.GA4777@salidar.me.mortis.eu> (raw)
In-Reply-To: <20100329184041.GU3823@infomag.iguana.be>

[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]

On Mon, Mar 29, 2010 at 08:40:41PM +0200, Wim Van Sebroeck wrote:
>> Don't terminate the watchdog daemon when fsync() fails because no
>> watchdog driver actually implements the fsync() syscall.
> 
> Wouldn't it be simpler then to just do an fsync without checking the error-result?

Yes, it definitly would be. Though I think it would be even simpler to
simply ditch the fsync() call. Considering that none of the watchdog
drivers implements it, nor can I think of a usecase where it would make
sense to implement (as more than a NOP).

So instead I suggest the patch following this line:
========================================================================
doc: watchdog simple example: don't fail on fsync()

Don't terminate the watchdog daemon when fsync() fails because no
watchdog driver actually implements the fsync() syscall.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
---
 Documentation/watchdog/src/watchdog-simple.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/Documentation/watchdog/src/watchdog-simple.c b/Documentation/watchdog/src/watchdog-simple.c
index 4cf72f3..ba45803 100644
--- a/Documentation/watchdog/src/watchdog-simple.c
+++ b/Documentation/watchdog/src/watchdog-simple.c
@@ -17,9 +17,6 @@ int main(void)
 			ret = -1;
 			break;
 		}
-		ret = fsync(fd);
-		if (ret)
-			break;
 		sleep(10);
 	}
 	close(fd);
-- 
1.6.4.4

-- 
Met vriendelijke groet,
With kind regards,
Giel van Schijndel

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

      reply	other threads:[~2010-03-29 19:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 12:22 Giel van Schijndel
2010-03-24  9:04 ` Giel van Schijndel
2010-03-29 18:40 ` Wim Van Sebroeck
2010-03-29 19:12   ` Giel van Schijndel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100329191209.GA4777@salidar.me.mortis.eu \
    --to=me@mortis.eu \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®