doc string file descriptor exhaustion fix

* src/doc.c (get_doc_string): Move newly-added check to a better
location (Bug#22814).
This commit is contained in:
Paul Eggert 2016-03-04 16:29:55 -08:00
parent 265141b332
commit c45a1ca3c4

View file

@ -126,9 +126,6 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
fd = emacs_open (name, O_RDONLY, 0);
if (fd < 0)
{
if ((errno == EMFILE) || (errno == ENFILE))
report_file_error ("Read error on documentation file", file);
#ifndef CANNOT_DUMP
if (!NILP (Vpurify_flag))
{
@ -141,6 +138,9 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
#endif
if (fd < 0)
{
if (errno == EMFILE || errno == ENFILE)
report_file_error ("Read error on documentation file", file);
SAFE_FREE ();
AUTO_STRING (cannot_open, "Cannot open doc string file \"");
AUTO_STRING (quote_nl, "\"\n");