diff options
| author | Paul Eggert | 2023-08-07 21:23:28 -0700 |
|---|---|---|
| committer | Paul Eggert | 2023-08-07 21:26:36 -0700 |
| commit | 85b6c150c8a356ebf3442fde2836364954aa938c (patch) | |
| tree | 0ea86860bb95571114c9a14a45a77b34f123bac6 /src/sysstdio.h | |
| parent | a579739e2b3f3c7218b14a7e41b78e7ddbded06c (diff) | |
| download | emacs-85b6c150c8a356ebf3442fde2836364954aa938c.tar.gz emacs-85b6c150c8a356ebf3442fde2836364954aa938c.zip | |
Fix some emacs_fopen confusion
Problem reported by Po Lu in:
https://lists.gnu.org/r/emacs-devel/2023-08/msg00195.html
* src/comp.c (comp_hash_source_file, Fcomp__release_ctxt):
* src/sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory):
Be more systematic about using emacs_fclose on streams that were
opened with emacs_fopen or emacs_fdopen. Do this even if not
Android, as this simplifies checking that it's done consistently.
* src/lisp.h (emacs_fclose): If it’s just fclose,
make it a macro rather than a function, to avoid confusing gcc
-Wmismatched-dealloc.
(emacs_fopen): Move decl here from sysstdio.h, because sysstdio.h
is included from non-Emacs executables and emacs_fopen is good
only inside Emacs.
* src/sysdep.c (emacs_fclose): Define as a function only if Android.
Diffstat (limited to 'src/sysstdio.h')
| -rw-r--r-- | src/sysstdio.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/sysstdio.h b/src/sysstdio.h index 5a973c833cc..8e9e5bec86c 100644 --- a/src/sysstdio.h +++ b/src/sysstdio.h | |||
| @@ -28,8 +28,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 28 | #include <attribute.h> | 28 | #include <attribute.h> |
| 29 | #include <unlocked-io.h> | 29 | #include <unlocked-io.h> |
| 30 | 30 | ||
| 31 | extern FILE *emacs_fopen (char const *, char const *) | ||
| 32 | ATTRIBUTE_MALLOC ATTRIBUTE_DEALLOC (fclose, 1); | ||
| 33 | extern void errputc (int); | 31 | extern void errputc (int); |
| 34 | extern void errwrite (void const *, ptrdiff_t); | 32 | extern void errwrite (void const *, ptrdiff_t); |
| 35 | extern void close_output_streams (void); | 33 | extern void close_output_streams (void); |