aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2020-08-29 15:52:29 +0200
committerUlrich Müller <ulm@gentoo.org>2020-08-29 15:52:29 +0200
commita350f05877e4477e6b3b75622b361f1a975dfe28 (patch)
tree6ee524f911ce3368740ce08db9a097719b8a1b7d /emacs
parentRemove 26.1 patchset. (diff)
downloademacs-patches-a350f05877e4477e6b3b75622b361f1a975dfe28.tar.gz
emacs-patches-a350f05877e4477e6b3b75622b361f1a975dfe28.tar.bz2
emacs-patches-a350f05877e4477e6b3b75622b361f1a975dfe28.zip
Fix compilation with glibc-2.32.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'emacs')
-rw-r--r--emacs/18.59/17_all_glibc-2.32.patch234
1 files changed, 234 insertions, 0 deletions
diff --git a/emacs/18.59/17_all_glibc-2.32.patch b/emacs/18.59/17_all_glibc-2.32.patch
new file mode 100644
index 0000000..540eae9
--- /dev/null
+++ b/emacs/18.59/17_all_glibc-2.32.patch
@@ -0,0 +1,234 @@
+Fix compilation with glibc-2.32.
+
+--- emacs-18.59-orig/src/ChangeLog
++++ emacs-18.59/src/ChangeLog
+@@ -1,3 +1,11 @@
++2020-08-29 Ulrich Mueller <ulm@gentoo.org>
++
++ * fileio.c (report_file_error, Finsert_file_contents)
++ (Fwrite_region): Use strerror(3) instead of str_errlist.
++ * process.c (wait_reading_process_input): Ditto.
++ (status_message, list_processes_1, sigchld_handler):
++ Use strsignal(3) instead of str_siglist.
++
+ 2019-08-29 Ulrich Mueller <ulm@gentoo.org>
+
+ * s-linux.h (PENDING_OUTPUT_COUNT): Fix conditional for new
+--- emacs-18.59-orig/src/fileio.c
++++ emacs-18.59/src/fileio.c
+@@ -39,20 +39,14 @@
+ #include "dir.h"
+ #include <perror.h>
+ #include <stddef.h>
+-#include <string.h>
+ #endif
+ #include <errno.h>
++#include <string.h>
+
+ #ifndef vax11c
+ extern int errno;
+-#if defined(LINUX) && !(defined (__GLIBC__) && (__GLIBC__ >= 2))
+-extern char *sys_errlist[];
+-#endif
+-extern int sys_nerr;
+ #endif
+
+-#define err_str(a) ((a) < sys_nerr ? sys_errlist[a] : "unknown error")
+-
+ #ifdef APOLLO
+ #include <sys/time.h>
+ #endif
+@@ -115,10 +109,7 @@
+ {
+ Lisp_Object errstring;
+
+- if (errno >= 0 && errno < sys_nerr)
+- errstring = build_string (sys_errlist[errno]);
+- else
+- errstring = build_string ("undocumented error code");
++ errstring = build_string (strerror (errno));
+
+ /* System error messages are capitalized. Downcase the initial
+ unless it is followed by a slash. */
+@@ -1676,7 +1667,7 @@
+
+ if (i < 0)
+ error ("IO error reading %s: %s",
+- XSTRING (filename)->data, err_str (errno));
++ XSTRING (filename)->data, strerror (errno));
+
+ notfound:
+
+@@ -1922,7 +1913,7 @@
+ current_buffer->modtime = st.st_mtime;
+
+ if (failure)
+- error ("IO error writing %s: %s", fn, err_str (save_errno));
++ error ("IO error writing %s: %s", fn, strerror (save_errno));
+
+ if (EQ (visit, Qt))
+ {
+--- emacs-18.59-orig/src/process.c
++++ emacs-18.59/src/process.c
+@@ -34,6 +34,7 @@
+
+ #include <stdio.h>
+ #include <errno.h>
++#include <string.h>
+ #include <setjmp.h>
+ #include <sys/file.h>
+ #include <sys/stat.h>
+@@ -171,10 +172,6 @@
+ #define WRETCODE(w) WEXITSTATUS (w)
+
+ extern errno;
+-extern sys_nerr;
+-#if defined(LINUX) && !(defined (__GLIBC__) && (__GLIBC__ >= 2))
+-extern char *sys_errlist[];
+-#endif
+
+ #ifndef BSD4_1
+ #ifndef SYS_SIGLIST_DECLARED
+@@ -360,7 +357,7 @@
+
+ if (EQ (symbol, Qsignal) || EQ (symbol, Qstop))
+ {
+- string = build_string (code < NSIG ? sys_siglist[code] : "unknown");
++ string = build_string (strsignal (code));
+ string2 = build_string (coredump ? " (core dumped)\n" : "\n");
+ XSTRING (string)->data[0] = DOWNCASE (XSTRING (string)->data[0]);
+ return concat2 (string, string2);
+@@ -869,7 +866,7 @@
+ Lisp_Object tem;
+ tem = Fcar (Fcdr (p->status));
+ if (XINT (tem) < NSIG)
+- write_string (sys_siglist [XINT (tem)], -1);
++ write_string (strsignal (XINT (tem)), -1);
+ else
+ Fprinc (symbol, Qnil);
+ }
+@@ -1762,7 +1759,7 @@
+ abort ();
+ #endif /* not AIX */
+ else
+- error("select error: %s", sys_errlist[xerrno]);
++ error("select error: %s", strerror (xerrno));
+ }
+ #ifdef SIGIO
+ #if defined (sun) || defined (APOLLO)
+@@ -2517,7 +2514,7 @@
+ if (WIFEXITED (w))
+ synch_process_retcode = WRETCODE (w);
+ else if (WIFSIGNALED (w))
+- synch_process_death = (char *) sys_siglist[WTERMSIG (w)];
++ synch_process_death = (char *) strsignal (WTERMSIG (w));
+ }
+
+ /* On some systems, we must return right away.
+--- emacs-18.59-orig/etc/ChangeLog
++++ emacs-18.59/etc/ChangeLog
+@@ -1,3 +1,10 @@
++2020-08-29 Ulrich Mueller <ulm@gentoo.org>
++
++ * movemail.c (pfatal_with_name, pfatal_and_delete, get_errmsg):
++ Use strerror(3) instead of str_errlist.
++ * emacsclient.c (main): Ditto.
++ * env.c (main): Ditto.
++
+ 2015-12-20 Ulrich Mueller <ulm@gentoo.org>
+
+ * Makefile (test-distrib): Respect CFLAGS and LDFLAGS.
+--- emacs-18.59-orig/etc/emacsclient.c
++++ emacs-18.59/etc/emacsclient.c
+@@ -56,7 +56,6 @@
+ #include <unistd.h>
+ #include <sys/stat.h>
+
+-extern int sys_nerr;
+ extern int errno;
+
+ main (argc, argv)
+@@ -131,7 +130,7 @@
+ {
+ fprintf (stderr, "%s: %s (%s)\n", argv[0],
+ "Cannot get current working directory",
+- (errno < sys_nerr) ? sys_errlist[errno] : "unknown error");
++ strerror (errno));
+ exit (1);
+ }
+
+--- emacs-18.59-orig/etc/env.c
++++ emacs-18.59/etc/env.c
+@@ -199,20 +199,14 @@
+ }
+ else
+ {
+- extern int errno, sys_nerr;
+-#if defined(LINUX) && !(defined (__GLIBC__) && (__GLIBC__ >= 2))
+- extern char *sys_errlist[];
+-#endif
++ extern int errno;
+
+ environ = nenv;
+ (void) execvp (*argv, argv);
+
+ fprintf (stderr, "%s: Cannot execute \"%s\"",
+ progname, *argv);
+- if (errno < sys_nerr)
+- fprintf (stderr, ": %s\n" , sys_errlist[errno]);
+- else
+- putc ('\n', stderr);
++ fprintf (stderr, ": %s\n" , strerror (errno));
+ exit (errno != 0 ? errno : 1);
+ }
+ }
+--- emacs-18.59-orig/etc/movemail.c
++++ emacs-18.59/etc/movemail.c
+@@ -323,26 +323,20 @@
+ pfatal_with_name (name)
+ char *name;
+ {
+- extern int errno, sys_nerr;
++ extern int errno;
+ char *s;
+
+- if (errno < sys_nerr)
+- s = concat ("", sys_errlist[errno], " for %s");
+- else
+- s = "cannot open %s";
++ s = concat ("", strerror (errno), " for %s");
+ fatal (s, name);
+ }
+
+ pfatal_and_delete (name)
+ char *name;
+ {
+- extern int errno, sys_nerr;
++ extern int errno;
+ char *s;
+
+- if (errno < sys_nerr)
+- s = concat ("", sys_errlist[errno], " for %s");
+- else
+- s = "cannot open %s";
++ s = concat ("", strerror (errno), " for %s");
+
+ unlink (name);
+ fatal (s, name);
+@@ -705,14 +699,9 @@
+ char *
+ get_errmsg ()
+ {
+- extern int errno, sys_nerr;
+- char *s;
++ extern int errno;
+
+- if (errno < sys_nerr)
+- s = sys_errlist[errno];
+- else
+- s = "unknown error";
+- return (s);
++ return strerror (errno);
+ }
+
+ putline (buf, err, f)