summaryrefslogtreecommitdiff
path: root/user/gnucobol/0002-errno.patch
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2023-08-17 20:58:19 -0500
committerZach van Rijn <me@zv.io>2023-08-17 20:59:55 -0500
commit21fe3ef399c25f030d6657e83cc635335f3a9f40 (patch)
tree7b5dc7d143d8c62c8d11da7bc8360f4d3f0c9c5b /user/gnucobol/0002-errno.patch
parent8f97a591ffdcd9877a2d46d0852c40829b8f08e6 (diff)
downloadpackages-21fe3ef399c25f030d6657e83cc635335f3a9f40.tar.gz
packages-21fe3ef399c25f030d6657e83cc635335f3a9f40.tar.bz2
packages-21fe3ef399c25f030d6657e83cc635335f3a9f40.tar.xz
packages-21fe3ef399c25f030d6657e83cc635335f3a9f40.zip
user/gnucobol: bump { 3.1.2 --> 3.2 }.
Diffstat (limited to 'user/gnucobol/0002-errno.patch')
-rw-r--r--user/gnucobol/0002-errno.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/user/gnucobol/0002-errno.patch b/user/gnucobol/0002-errno.patch
new file mode 100644
index 000000000..968190733
--- /dev/null
+++ b/user/gnucobol/0002-errno.patch
@@ -0,0 +1,26 @@
+See also:
+
+* https://git.adelielinux.org/adelie/packages/-/issues/1045#note_13472
+
+--- a/cobc/cobc.c.gc32 Sat Jul 22 17:01:52 2023
++++ b/cobc/cobc.c Thu Aug 17 23:01:33 2023
+@@ -2358,6 +2358,10 @@
+ DECLNORET static void COB_A_NORETURN
+ cobc_terminate (const char *str)
+ {
++ /* must be executed before anything that may adjust errno, ...
++ like the listing code below. */
++ const char *errno_str = cb_get_strerror ();
++
+ if (cb_src_list_file) {
+ set_listing_date ();
+ set_standard_title ();
+@@ -2365,7 +2369,7 @@
+ cobc_elided_strcpy (cb_listing_filename, str, sizeof (cb_listing_filename), 0);
+ print_program_header ();
+ }
+- cb_perror (0, "cobc: %s: %s", str, cb_get_strerror ());
++ cb_perror (0, "cobc: %s: %s", str, errno_str);
+ if (cb_src_list_file) {
+ print_program_trailer ();
+ }