diff mbox series

AT&T Unix PC : 18-glibc-stdio

Message ID 2312702e-faff-45f2-a29b-35578d853502@knaff.lu (mailing list archive)
State Under Review
Delegated to: Herbert Xu
Headers show
Series AT&T Unix PC : 18-glibc-stdio | expand

Commit Message

Alain Knaff Nov. 17, 2024, 6:54 p.m. UTC
Hi,

This fixed USE_GLIBC_STDIO mode.

This also concludes this patch series for UnixPC support.

Thanks for reading.

Regards,

Alain
diff mbox series

Patch

diff -X ../exclude.txt -urN dash-0.5.12+17-signed-size-t/src/eval.c dash-0.5.12+18-glibc-stdio/src/eval.c
--- dash-0.5.12+17-signed-size-t/src/eval.c	2024-10-20 08:37:55.802683032 +0000
+++ dash-0.5.12+18-glibc-stdio/src/eval.c	2024-09-01 07:04:06.960988580 +0000
@@ -833,7 +833,11 @@ 
 	if (iflag && funcline == 0 && argc > 0)
 		lastarg = nargv[-1];
 
+#ifdef USE_GLIBC_STDIO
+	preverrout.stream = stderr;
+#else
 	preverrout.fd = 2;
+#endif
 	expredir(cmd->ncmd.redirect);
 	redir_stop = pushredir(cmd->ncmd.redirect);
 	status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH|REDIR_SAVEFD2);
diff -X ../exclude.txt -urN dash-0.5.12+17-signed-size-t/src/output.c dash-0.5.12+18-glibc-stdio/src/output.c
--- dash-0.5.12+17-signed-size-t/src/output.c	2024-10-20 08:37:55.814683315 +0000
+++ dash-0.5.12+18-glibc-stdio/src/output.c	2024-09-01 07:04:06.960988580 +0000
@@ -77,7 +77,7 @@ 
 };
 struct output errout = {
 	.stream = 0, .nextc = 0, .end = 0, .buf = 0, .bufsize = 0, .fd = 2, .flags = 0
-}
+};
 #ifdef notyet
 struct output memout = {
 	.stream = 0, .nextc = 0, .end = 0, .buf = 0, .bufsize = 0, .fd = MEM_OUT, .flags = 0
@@ -90,13 +90,13 @@ 
 struct output errout = {
 	.nextc = 0, .end = 0, .buf = 0, .bufsize = 0, .fd = 2, .flags = 0
 };
-struct output preverrout;
 #ifdef notyet
 struct output memout = {
 	.nextc = 0, .end = 0, .buf = 0, .bufsize = 0, .fd = MEM_OUT, .flags = 0
 };
 #endif
 #endif
+struct output preverrout;
 struct output *out1 = &output;
 struct output *out2 = &errout;
 
@@ -215,7 +215,6 @@ 
 }
 
 
-#ifndef USE_GLIBC_STDIO
 
 
 void
@@ -224,7 +223,6 @@ 
 	char buf = c;
 	outmem(&buf, 1, dest);
 }
-#endif
 
 
 void
@@ -378,7 +376,6 @@ 
 }
 
 
-#ifdef notyet
 #ifdef USE_GLIBC_STDIO
 void initstreams() {
 	output.stream = stdout;
@@ -386,6 +383,7 @@ 
 }
 
 
+#ifdef notyet
 void
 openmemout(void) {
 	INTOFF;
diff -X ../exclude.txt -urN dash-0.5.12+17-signed-size-t/src/output.h dash-0.5.12+18-glibc-stdio/src/output.h
--- dash-0.5.12+17-signed-size-t/src/output.h	2024-10-19 22:16:41.624247695 +0000
+++ dash-0.5.12+18-glibc-stdio/src/output.h	2024-11-10 21:55:48.781059156 +0000
@@ -65,9 +65,7 @@ 
 
 void outmem(const char *, size_t, struct output *);
 void outstr(const char *, struct output *);
-#ifndef USE_GLIBC_STDIO
 void outcslow(int, struct output *);
-#endif
 void flushall(void);
 void flushout(struct output *);
 void outfmt(struct output *, const char *, ...)
@@ -81,13 +79,11 @@ 
 void doformat(struct output *, const char *, va_list);
 #endif
 int xwrite(int, const void *, size_t);
-#ifdef notyet
 #ifdef USE_GLIBC_STDIO
 void initstreams(void);
 void openmemout(void);
 int __closememout(void);
 #endif
-#endif
 
 static inline void
 freestdout()
diff -X ../exclude.txt -urN dash-0.5.12+17-signed-size-t/src/redir.c dash-0.5.12+18-glibc-stdio/src/redir.c
--- dash-0.5.12+17-signed-size-t/src/redir.c	2024-10-21 10:44:12.732533133 +0000
+++ dash-0.5.12+18-glibc-stdio/src/redir.c	2024-10-20 22:07:35.390055840 +0000
@@ -180,7 +180,11 @@ 
 		out2 = &memout;
 #endif
 	if (flags & REDIR_SAVEFD2 && sv->renamed[2] >= 0)
+#ifdef USE_GLIBC_STDIO
+		preverrout.stream = fdopen(sv->renamed[2],"a");
+#else
 		preverrout.fd = sv->renamed[2];
+#endif
 }