[syslinux] isohybrid: seek error - 6: Invalid argument

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Tue Sep 14 16:48:22 PDT 2010


  On 09/14/2010 03:38 AM, P J P wrote:
> diff --git a/utils/isohybrid.c b/utils/isohybrid.c
> index 57c1015..7ee9a7f 100644
> --- a/utils/isohybrid.c
> +++ b/utils/isohybrid.c
> @@ -543,15 +543,11 @@ main(int argc, char *argv[])
>
>       if (padding)
>       {
> -        if (!(buf = realloc(buf, padding)))
> -            err(1, "%s: could not re-size buffer", argv[0]);
> +        if (fsync(fileno(fp)))
> +            err(1, "%s: could not synchronise", argv[0]);
>
> -        if (fseek(fp, isostat.st_size, SEEK_SET))
> -            err(1, "%s: seek error - 6", argv[0]);
> -
> -        memset(buf, 0, padding);
> -        if (fwrite(buf, sizeof(char), padding, fp) != (size_t)padding)
> -            err(1, "%s: write error - 2", argv[0]);
> +        if (ftruncate(fileno(fp), isostat.st_size + padding))
> +            err(1, "%s: could not add padding bytes", argv[0]);
>       }
>
>       free(buf);
>
Tested and works perfectly. Thanks.

-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1





More information about the Syslinux mailing list