Re: [PATCH 04/10] compile-i386.c: don't mix calls to write(2) with stdio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Compile-i386 is pretty much not maintained any more.

On Tue, Aug 5, 2014 at 2:36 AM, Ramsay Jones <ramsay@xxxxxxxxxxxxxxxxxxx> wrote:
>
> -       write(STDOUT_FILENO, s, strlen(s));
> +       printf("%s", s);

This change fix nothing. "printf" can return how many bytes it is written.
In the case that "write" can fail, "printf" can fail as well. e.g. disk full.
This patch did not check the return value from printf either.

If we really care about return value of write, (we don't). We can do some thing
like:
if (write(...)< len)
    die("....");

That at least check the return value.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux