Zsh Mailing List Archive
Messages sorted by:
Re: Re: [PATCH] Use access instead of stat in hashdir
- X-seq: zsh-workers 30190
- From: Raghavendra D Prabhu <raghu.prabhu13@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Re: [PATCH] Use access instead of stat in hashdir
- Date: Wed, 8 Feb 2012 04:16:13 +0530
- Cc: Zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :x-operating-system:x-editor:user-agent; bh=dCpzyM+7uc8SQHvTDQxc1YpFVy2aEGj/hK2mCCdzfVU=; b=MSlYS2/1LEYc4kL6VwlgG10chgDjT4Omj5B745zyRzXcqVXOluKwkrFsSFn6nHq7x6 xH9lRHl4d8Ck9AHspUAJJQusU6cx4NmzHIc7aSM/DmbwnFn1MJONblwlcGhcTBqVjjzX ouxouRM+felb+5zaVeu/HQVhwEedNJMGw5uuU=
- In-reply-to: <120206082008.ZM8593@torch.brasslantern.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh workers <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20120206131302.GA46184@Xye> <120206082008.ZM8593@torch.brasslantern.com>
* On Mon, Feb 06, 2012 at 08:20:08AM -0800, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
Thanks for the suggestion, but ...
On Feb 6, 6:43pm, Raghavendra D Prabhu wrote:
} I found that using access instead of two stat calls
There's only one stat() call in the lines that you changed ...?
Sorry, I meant the other checks.
} results in
} faster rehash when it is done. I came across this when I noticed
} too many stat calls while 'strace -c'
It also results in treating non-regular files as candidates for being
in the hash table, unless there's something about access() that is
implicitly performing the S_ISREG() test.
Need to verify this but for X_OK the file will need to be regular
Yes, I recently merged the tree with mine which I was using
before HASHEXECUTABLESONLY was there, need to check on that.
So you've broken the correctness of the HASH_EXECUTABLES_ONLY option.
Why not just leave it unset instead? That's why it's an option.
} if (unset(HASHEXECUTABLESONLY) ||
} - (stat(pathbuf, &statbuf) == 0 &&
} - S_ISREG(statbuf.st_mode) && (statbuf.st_mode & S_IXUGO)))
} + !access(pathbuf,X_OK))
} add = 1;
GPG Id : 0xD72BE977
Fingerprint: B93F EBCB 8E05 7039 CD3C A4B8 A616 DCA1 D72B E977
Description: PGP signature
Messages sorted by: