1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
From: Jochen Friedrich <jochen@scram.de>
Subject: Change errno handling to fix Hurd (Closes: #164191, #164194)
Forwarded: yes
---
inc/toast.h | 9 +++++++--
src/code.c | 4 ++--
2 files changed, 9 insertions(+), 4 deletions(-)
Index: libgsm-1.0.23/inc/toast.h
===================================================================
--- libgsm-1.0.23.orig/inc/toast.h 2025-11-08 00:10:15.334538209 +0100
+++ libgsm-1.0.23/inc/toast.h 2025-11-08 00:10:15.330538174 +0100
@@ -20,11 +20,12 @@
#include <stdio.h>
#include <ctype.h>
+#include <pthread.h>
#include <signal.h>
#include <errno.h>
-#ifndef HAS_ERRNO_DECL
- extern int errno;
+#ifndef errno
+ extern int errno;
#endif
#ifdef HAS_LIMITS_H
@@ -41,6 +42,10 @@
# endif
#endif
+#ifdef HAS_STDIO_H
+# include <stdio.h>
+#endif
+
#include "gsm.h"
#ifndef S_ISREG
Index: libgsm-1.0.23/src/toast.c
===================================================================
--- libgsm-1.0.23.orig/src/toast.c 2025-11-08 00:10:16.530548400 +0100
+++ libgsm-1.0.23/src/toast.c 2025-11-08 00:16:20.921645121 +0100
@@ -251,8 +251,8 @@
{
char * s;
if (!(s = malloc(len))) {
- fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n",
- progname, (int)len);
+ fprintf(stderr, "%s: failed to malloc %ld bytes -- abort\n",
+ progname, (long)len);
onintr(0);
exit(1);
}
@@ -386,7 +386,8 @@
ut[0] = instat.st_atime;
ut[1] = instat.st_mtime;
- (void) utime(outname, ut);
+ (void) utime(outname, (struct utimbuf *)ut);
+
#endif /* UTIMBUF */
}
@@ -586,8 +587,8 @@
if (cc != sizeof(s)) {
if (cc >= 0) fprintf(stderr,
- "%s: incomplete frame (%d byte%s missing) from %s\n",
- progname, (int)(sizeof(s) - cc),
+ "%s: incomplete frame (%ld byte%s missing) from %s\n",
+ progname, (long)(sizeof(s) - cc),
&"s"[sizeof(s) - cc == 1],
inname ? inname : "stdin" );
gsm_destroy(r);
|