[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] md5: accepts a new --threads option
From: |
Jim Meyering |
Subject: |
Re: [PATCH] md5: accepts a new --threads option |
Date: |
Fri, 23 Oct 2009 12:30:57 +0200 |
Pádraig Brady wrote:
> Jim Meyering wrote:
>> Pádraig Brady wrote:
>> ...
>>> copy_file_preserving (const char *src_filename, const char *dest_filename)
>>> @@ -58,8 +60,7 @@ copy_file_preserving (const char *src_filename, const
>>> char *dest_filename)
>>> struct stat statbuf;
>>> int mode;
>>> int dest_fd;
>>> - char buf[4096];
>>> - const size_t buf_size = sizeof (buf);
>>> + char *buf = xmalloc (IO_SIZE);
>>
>> Hi Pádraig,
>>
>> We must not use functions like xmalloc (that can exit)
>> from within library code.
>>
>> Instead, you might want to use malloc, and if that fails,
>> revert to using the buffer on the stack.
>
> copy_file_preserving() already exits on error
> (and is documented to do so), which is why
> I used xmalloc there?
<blush!> You're right. Don't mind me ;-)
- Re: [PATCH] md5: accepts a new --threads option, (continued)
- RE: [PATCH] md5: accepts a new --threads option, Voelker, Bernhard, 2009/10/21
- Re: [PATCH] md5: accepts a new --threads option, Pádraig Brady, 2009/10/22
- Re: [PATCH] md5: accepts a new --threads option, Eric Blake, 2009/10/22
- Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/22
- Re: [PATCH] md5: accepts a new --threads option, Paolo Bonzini, 2009/10/22
- Re: [PATCH] md5: accepts a new --threads option, Pádraig Brady, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option, Pádraig Brady, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option,
Jim Meyering <=
- Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option, Paolo Bonzini, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option, Pádraig Brady, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option, Pádraig Brady, 2009/10/23
- Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/23
- Re: thread stack size, Bruno Haible, 2009/10/24
- Re: thread stack size, Paolo Bonzini, 2009/10/24
- Re: thread stack size, Bruno Haible, 2009/10/25
- Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/23