bug-gnulib
[Top][All Lists]
Advanced

[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 ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]