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

Re: Safe file update library ready (sort of)



On Wed, Jan 26, 2011 at 12:22 PM, Adam Borowski <kilobyte@angband.pl> wrote:
>> typedef struct {
>>         int fd;
>>         char buffer[PATH_MAX];
>> } safe_t;
>
> Except, you can't rely on PATH_MAX on any modern system.  It's defined in
> Linux headers to an arbitrary value to make old code compile, but for
> example Hurd folks decided to not define it altogether to make buggy code
> fail during compilation rather than on runtime.

That's easily solved by a dynamic allocation.

Olaf


Reply to: