GNU bug report logs - #13391
dd silently ignores lseek error

Previous Next

Package: coreutils;

Reported by: Neil Klopfenstein <neil.klopfenstein <at> gmail.com>

Date: Tue, 8 Jan 2013 18:24:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #22 received at 13391 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: 13391 <at> debbugs.gnu.org, P <at> draigBrady.com, neil.klopfenstein <at> gmail.com
Subject: Re: bug#13391: dd silently ignores lseek error
Date: Wed, 09 Jan 2013 08:36:25 +0100

On 01/09/2013 02:14 AM, Pádraig Brady wrote:
> I had a look around for a tool to verify
> that a file/device supports the seek operation
> and couldn't find one.
> So this seems like useful functionality.
> Worth applying the attached?

> * cfg.mk (sc_dd_O_FLAGS): Add O_SEEKABLE to the list of private
> flags with a a single underscore.

s/a a/a/

> @@ -619,6 +628,9 @@ Each FLAG symbol may be:\n\
>        if (O_SEEK_BYTES)
>          fputs (_("  seek_bytes  treat 'seek=N' as a byte count (oflag only)\n\
>  "), stdout);
> +      if (O_SEEKABLE)
> +        fputs (_("  seekable  fail unless seekable\n\
> +"), stdout);

no line break needed here.

> +  offset = lseek (STDOUT_FILENO, 0, SEEK_CUR);
> +  output_seekable = (0 <= offset);
> +  if (! input_seekable && (input_flags & O_SEEKABLE))
> +    {
> +      error (EXIT_FAILURE, input_seek_errno, _("input is not seekable %s"),
> +             quote (input_file));
> +    }

why not check input_seekable where it is set - ~60 lines above?

Have a nice day,
Berny





This bug report was last modified 12 years and 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.