All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Patrick Georgi <patrick-U1IrdZU7gScKt1dFYRw6Gg@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 4/5] set: check seek success
Date: Thu, 02 Oct 2014 16:58:47 -0600	[thread overview]
Message-ID: <542DD8A7.7040705@wwwdotorg.org> (raw)
In-Reply-To: <1412237788-20611-4-git-send-email-patrick-U1IrdZU7gScKt1dFYRw6Gg@public.gmane.org>

On 10/02/2014 02:16 AM, Patrick Georgi wrote:
> This could silently fail which leads to surprising behaviour.

> diff --git a/src/set.c b/src/set.c

> -	fseek(fp, offset, SEEK_SET);
> +	if (!fseek(fp, offset, SEEK_SET)) {

fseek is supposed to return the current offset, or -1 on error. I think 
that should say if (fseek(...) < 0) or if (fseek(...) == -1)) or if 
(fseek(...) != offset).

  parent reply	other threads:[~2014-10-02 22:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  8:16 [PATCH 1/5] configure.ac: Don't search for c++ compiler Patrick Georgi
     [not found] ` <1412237788-20611-1-git-send-email-patrick-U1IrdZU7gScKt1dFYRw6Gg@public.gmane.org>
2014-10-02  8:16   ` [PATCH 2/5] cbootimage: simplify code Patrick Georgi
2014-10-02  8:16   ` [PATCH 3/5] data_layout: improve memory handling Patrick Georgi
2014-10-02  8:16   ` [PATCH 4/5] set: check seek success Patrick Georgi
     [not found]     ` <1412237788-20611-4-git-send-email-patrick-U1IrdZU7gScKt1dFYRw6Gg@public.gmane.org>
2014-10-02 22:58       ` Stephen Warren [this message]
     [not found]         ` <542DD8A7.7040705-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-10-03  6:54           ` Patrick Georgi
     [not found]             ` <542E4817.1000604-U1IrdZU7gScKt1dFYRw6Gg@public.gmane.org>
2014-10-03 15:38               ` Stephen Warren
2014-10-02  8:16   ` [PATCH 5/5] data_layout: fail better on file access errors Patrick Georgi
2014-10-02 23:09   ` [PATCH 1/5] configure.ac: Don't search for c++ compiler Stephen Warren
2014-11-08 22:14   ` [PATCH 4/5 v2] set: check seek success Patrick Georgi
     [not found]     ` <545E95B1.5030703-U1IrdZU7gScKt1dFYRw6Gg@public.gmane.org>
2014-11-09  1:04       ` Thierry Reding
     [not found]         ` <14992150720.2771.879d79c6f3490faa837fa11cb97f42bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-11-09  7:57           ` Patrick Georgi
2014-11-10  8:51       ` Thierry Reding
2014-11-10  9:08         ` Thierry Reding
2014-11-10 16:31         ` Stephen Warren
     [not found]           ` <5460E87B.1040209-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-11-17 11:32             ` Thierry Reding

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=542DD8A7.7040705@wwwdotorg.org \
    --to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=patrick-U1IrdZU7gScKt1dFYRw6Gg@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.