m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 6/6] esyscmd: fdopen() in text mode explicitly on OS/2


From: KO Myung-Hun
Subject: [PATCH 6/6] esyscmd: fdopen() in text mode explicitly on OS/2
Date: Wed, 19 Nov 2014 13:06:51 +0900

On OS/2 kLIBC, fdopen() creates a stream in a mode of a file
descriptor. So specify "t" to open a stream in text mode explicitly
on OS/2.

* modules/gnu.c (esyscmd): fdopen() in text mode on OS/2.
---
 modules/gnu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/gnu.c b/modules/gnu.c
index 874502e..7abd2cf 100644
--- a/modules/gnu.c
+++ b/modules/gnu.c
@@ -684,7 +684,12 @@ M4BUILTIN_HANDLER (esyscmd)
           m4_set_sysval (127);
           return;
         }
-      pin = fdopen (fd, "r");
+#if OS2
+# define MODE_TEXT "t"
+#else
+# define MODE_TEXT ""
+#endif
+      pin = fdopen (fd, "r" MODE_TEXT);
       if (!pin)
         {
           m4_error (context, 0, errno, me, _("cannot run command %s"),
-- 
1.8.5.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]