From: Alexey Dobriyan <adobriyan@gmail.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: mmarek@suse.com, akpm@linux-foundation.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] fixdep: faster CONFIG_ search
Date: Wed, 24 Aug 2016 10:19:16 +0300 [thread overview]
Message-ID: <20160824071916.GA1844@p183.telecom.by> (raw)
In-Reply-To: <20160824050108.GA19050@ravnborg.org>
On Wed, Aug 24, 2016 at 07:01:08AM +0200, Sam Ravnborg wrote:
> > - map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
> > - if ((long) map == -1) {
> > - perror("fixdep: mmap");
> > + map = malloc(st.st_size + 1);
> > + if (!map) {
> > + perror("fixdep: malloc");
> > close(fd);
> > return;
> > }
> > + if (read(fd, map, st.st_size) != st.st_size) {
> > + perror("fixdep: read");
> > + close(fd);
> > + return;
> > + }
> > + map[st.st_size] = '\0';
> > + close(fd);
> >
> > - parse_config_file(map, st.st_size);
> > -
> > - munmap(map, st.st_size);
> > + parse_config_file(map);
> >
> > - close(fd);
> > + free(map);
> > }
> This change is not described in the changelog..
> What is the rationale?
There is no raw memory equivalent of strstr(), so a file is made into
a string.
prev parent reply other threads:[~2016-08-24 7:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 18:47 [PATCH] fixdep: faster CONFIG_ search Alexey Dobriyan
2016-08-23 21:29 ` Michal Marek
2016-08-24 5:01 ` Sam Ravnborg
2016-08-24 7:19 ` Alexey Dobriyan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160824071916.GA1844@p183.telecom.by \
--to=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=mmarek@suse.com \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox