m4-patches
[Top][All Lists]
Advanced

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

[PATCH 4/4] m4_esyscmd: fdopen() with a text mode explicitly on OS/2


From: KO Myung-Hun
Subject: [PATCH 4/4] m4_esyscmd: fdopen() with a text mode explicitly on OS/2
Date: Wed, 19 Nov 2014 12:54:17 +0900

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

* src/builtin.c (m4_esyscmd): fdopen() in a text mode on OS/2.
---
 src/builtin.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/builtin.c b/src/builtin.c
index e101838..7a73b36 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1019,7 +1019,12 @@ m4_esyscmd (struct obstack *obs, int argc, token_data 
**argv)
       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 == NULL)
     {
       M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd));
-- 
1.8.5.2




reply via email to

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