Commit c45a1ca3 authored by Paul Eggert's avatar Paul Eggert

doc string file descriptor exhaustion fix

* src/doc.c (get_doc_string): Move newly-added check to a better
location (Bug#22814).
parent 265141b3
...@@ -126,9 +126,6 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) ...@@ -126,9 +126,6 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
fd = emacs_open (name, O_RDONLY, 0); fd = emacs_open (name, O_RDONLY, 0);
if (fd < 0) if (fd < 0)
{ {
if ((errno == EMFILE) || (errno == ENFILE))
report_file_error ("Read error on documentation file", file);
#ifndef CANNOT_DUMP #ifndef CANNOT_DUMP
if (!NILP (Vpurify_flag)) if (!NILP (Vpurify_flag))
{ {
...@@ -141,6 +138,9 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) ...@@ -141,6 +138,9 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
#endif #endif
if (fd < 0) if (fd < 0)
{ {
if (errno == EMFILE || errno == ENFILE)
report_file_error ("Read error on documentation file", file);
SAFE_FREE (); SAFE_FREE ();
AUTO_STRING (cannot_open, "Cannot open doc string file \""); AUTO_STRING (cannot_open, "Cannot open doc string file \"");
AUTO_STRING (quote_nl, "\"\n"); AUTO_STRING (quote_nl, "\"\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment