bug-coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] install: add -C option to install file only when necessary


From: Kamil Dudka
Subject: Re: [PATCH] install: add -C option to install file only when necessary
Date: Tue, 17 Feb 2009 12:17:35 +0100
User-agent: KMail/1.9.6 (enterprise 0.20071012.724442)

On Monday 16 February 2009 15:24:21 Jim Meyering wrote:
> Please write this as:
>
> static bool
> extra_mode (mode_t mode)
> {
>   return mode & ~S_IRWXUGO;
> }
Slightly changed to deal only with least significant 12bits:
static bool
extra_mode (mode_t input)
{
  const mode_t mask = ~S_IRWXUGO & 0xFFF;
  return input & mask;
}

On Monday 16 February 2009 15:56:40 Pádraig Brady wrote:
> I think 2 malloc'd buffers would be better.
> Also 4KiB it probably enough, as files will usually differ
> in the first 4096 bytes and if not readahead will be done
> underneath if appropriate.
It sounds like optimization problem to me :-) For statically allocated buffers 
I prefer the 4KiB size. Common install usage is without --compare option and 
in this situation seems 128Kib of untouched memory to be a bit waste.


Kamil

Attachment: 0001-install-add-compare-C-option-to-install-file-o.patch
Description: Text Data


reply via email to

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