sxemacs -nw would quit right after startup
* src/lread.c (locate_file_in_directory_mapper): Only close
closure->fd if non-zero, which would be the result of the attempt
to check the file using access.
Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
return 1;
} else {
- close(closure->fd);
+ /* Avoid closing stdin upon success of
+ access, where closure->fd would be
+ 0 but the file is not open on that
+ descriptor
+ */
+ if(closure->fd > 0)
+ close(closure->fd);
closure->fd=-1;
}
}