Otherwise chaining modes is liable to run out of address space
rather rapidly.
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8284
cda61777-01e9-0310-a592-
d414129be87e
gcc $(LFLAGS) -o agedu $(AGEDU_OBJS)
config.h: configure
gcc $(LFLAGS) -o agedu $(AGEDU_OBJS)
config.h: configure
rm -f Makefile # we keep using _this_ Makefile
configure: configure.ac
rm -f Makefile # we keep using _this_ Makefile
configure: configure.ac
TODO list for agedu
===================
TODO list for agedu
===================
- - we should munmap in all operating modes where we mmapped,
- otherwise chaining them will run out of address space
-
- we could still be using more of the information coming from
autoconf. Our config.h is defining a whole bunch of HAVE_FOOs for
particular functions (e.g. HAVE_INET_NTOA, HAVE_MEMCHR,
- we could still be using more of the information coming from
autoconf. Our config.h is defining a whole bunch of HAVE_FOOs for
particular functions (e.g. HAVE_INET_NTOA, HAVE_MEMCHR,
querydir[--pathlen] = '\0';
text_query(mappedfile, querydir, textcutoff, tqdepth);
querydir[--pathlen] = '\0';
text_query(mappedfile, querydir, textcutoff, tqdepth);
+
+ munmap(mappedfile, totalsize);
} else if (mode == HTML) {
char *querydir = actions[action].arg;
size_t pathlen;
} else if (mode == HTML) {
char *querydir = actions[action].arg;
size_t pathlen;
cfg.newest = htmlnewest;
html = html_query(mappedfile, xi, &cfg);
fputs(html, stdout);
cfg.newest = htmlnewest;
html = html_query(mappedfile, xi, &cfg);
fputs(html, stdout);
+
+ munmap(mappedfile, totalsize);
} else if (mode == DUMP) {
size_t maxpathlen;
char *buf;
} else if (mode == DUMP) {
size_t maxpathlen;
char *buf;
while ((tf = triewalk_next(tw, buf)) != NULL)
dump_line(buf, tf);
triewalk_free(tw);
while ((tf = triewalk_next(tw, buf)) != NULL)
dump_line(buf, tf);
triewalk_free(tw);
+
+ munmap(mappedfile, totalsize);
} else if (mode == HTTPD) {
struct html_config pcfg;
struct httpd_config dcfg;
} else if (mode == HTTPD) {
struct html_config pcfg;
struct httpd_config dcfg;
pcfg.oldest = htmloldest;
pcfg.newest = htmlnewest;
run_httpd(mappedfile, auth, &dcfg, &pcfg);
pcfg.oldest = htmloldest;
pcfg.newest = htmlnewest;
run_httpd(mappedfile, auth, &dcfg, &pcfg);
+ munmap(mappedfile, totalsize);
} else if (mode == REMOVE) {
if (remove(filename) < 0) {
fprintf(stderr, "%s: %s: remove: %s\n", PNAME, filename,
} else if (mode == REMOVE) {
if (remove(filename) < 0) {
fprintf(stderr, "%s: %s: remove: %s\n", PNAME, filename,