comparison src/lread.c @ 8596:ccd3c3ca2aef

(O_RDONLY): Defined. (openp): Use it.
author Richard M. Stallman <rms@gnu.org>
date Tue, 23 Aug 1994 22:28:49 +0000
parents 94f524e0d5cd
children 2ff6fed642b1
comparison
equal deleted inserted replaced
8595:099f80df77bf 8596:ccd3c3ca2aef
57 #undef SHORTBITS 57 #undef SHORTBITS
58 #endif 58 #endif
59 59
60 #include <math.h> 60 #include <math.h>
61 #endif /* LISP_FLOAT_TYPE */ 61 #endif /* LISP_FLOAT_TYPE */
62
63 #ifndef O_RDONLY
64 #define O_RDONLY 0
65 #endif
62 66
63 extern int errno; 67 extern int errno;
64 68
65 Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; 69 Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list;
66 Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; 70 Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist;
575 { 579 {
576 /* Check that we can access or open it. */ 580 /* Check that we can access or open it. */
577 if (exec_only) 581 if (exec_only)
578 fd = (access (fn, X_OK) == 0) ? 1 : -1; 582 fd = (access (fn, X_OK) == 0) ? 1 : -1;
579 else 583 else
580 fd = open (fn, 0, 0); 584 fd = open (fn, O_RDONLY, 0);
581 585
582 if (fd >= 0) 586 if (fd >= 0)
583 { 587 {
584 /* We succeeded; return this descriptor and filename. */ 588 /* We succeeded; return this descriptor and filename. */
585 if (storeptr) 589 if (storeptr)