diff options
| author | Andrea Corallo | 2020-05-30 11:13:38 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-05-30 11:45:19 +0100 |
| commit | 15c121ee0b5cbe005548eeba09dd54b145b2e258 (patch) | |
| tree | 581eacfcdb9d000cf11bdad2af48d98d38cfee23 /src | |
| parent | 3fa73fa0fb1caedd10553d9f3185635c039319fd (diff) | |
| download | emacs-15c121ee0b5cbe005548eeba09dd54b145b2e258.tar.gz emacs-15c121ee0b5cbe005548eeba09dd54b145b2e258.zip | |
* Avoid calling Ffile_exists_p too early
Being quite early in startup initialization is better not to rely on
Ffile_exists_p, this call Ffile_expand and not all the necessary
initialization already happened.
* src/pdumper.c (dump_do_dump_relocation): Use fopen instead of
Ffile_exists_p.
Diffstat (limited to 'src')
| -rw-r--r-- | src/pdumper.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/pdumper.c b/src/pdumper.c index b40a29c02ac..19dbacca896 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -5301,17 +5301,25 @@ dump_do_dump_relocation (const uintptr_t dump_base, | |||
| 5301 | if (!CONSP (comp_u->file)) | 5301 | if (!CONSP (comp_u->file)) |
| 5302 | error ("Trying to load incoherent dumped .eln"); | 5302 | error ("Trying to load incoherent dumped .eln"); |
| 5303 | 5303 | ||
| 5304 | /* Check just once if this is a local build or Emacs was installed. */ | ||
| 5304 | if (installation_state == UNKNOWN) | 5305 | if (installation_state == UNKNOWN) |
| 5305 | /* Check just once if is a local build or Emacs got installed. */ | 5306 | { |
| 5306 | installation_state = | 5307 | char *fname = SSDATA (concat2 (Vinvocation_directory, |
| 5307 | NILP (Ffile_exists_p (concat2 (Vinvocation_directory, | 5308 | XCAR (comp_u->file))); |
| 5308 | XCAR (comp_u->file)))) | 5309 | FILE *file; |
| 5309 | ? LOCAL_BUILD : INSTALLED; | 5310 | if ((file = fopen (fname, "r"))) |
| 5311 | { | ||
| 5312 | fclose (file); | ||
| 5313 | installation_state = INSTALLED; | ||
| 5314 | } | ||
| 5315 | else | ||
| 5316 | installation_state = LOCAL_BUILD; | ||
| 5317 | } | ||
| 5310 | 5318 | ||
| 5311 | comp_u->file = | 5319 | comp_u->file = |
| 5312 | concat2 (Vinvocation_directory, | 5320 | concat2 (Vinvocation_directory, |
| 5313 | installation_state == LOCAL_BUILD | 5321 | installation_state == INSTALLED |
| 5314 | ? XCDR (comp_u->file) : XCAR (comp_u->file)); | 5322 | ? XCAR (comp_u->file) : XCDR (comp_u->file)); |
| 5315 | #ifdef WINDOWSNT | 5323 | #ifdef WINDOWSNT |
| 5316 | comp_u->cfile = xlispstrdup (comp_u->file); | 5324 | comp_u->cfile = xlispstrdup (comp_u->file); |
| 5317 | #endif | 5325 | #endif |