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: Pádraig Brady
Subject: Re: [PATCH] md5: accepts a new --threads option
Date: Fri, 23 Oct 2009 11:22:05 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

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?

cheers,
Pádraig.




reply via email to

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