Hi/2.

Paul Eggert wrote:
> On 12/01/2014 11:49 PM, KO Myung-Hun wrote:
>>
>> First, we don't have copyright assignment from Paul Smedley, so we can't
>> install the patch without having that cleared up one way or another.
>>
>> Which ways ?
> 
> Either get a copyright assignment from Smedley, or rewrite the change
> from scratch without using Smedley's code.  Given the number of problems
> with the patch the latter is probably better.
> 

Ok. How about this ?

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM

Korean OS/2 User Community : http://www.ecomstation.co.kr

From 5edee471f3e45d962c6112e29ceaeadd1d3e902b Mon Sep 17 00:00:00 2001
From: KO Myung-Hun <k...@chollian.net>
Date: Fri, 28 Nov 2014 16:47:12 +0900
Subject: [PATCH] fdopendir: port to OS/2 kLIBC

* lib/fdopendir.c (fdopendir): Implement on OS/2 kLIBC.
---
 lib/fdopendir.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/fdopendir.c b/lib/fdopendir.c
index b6c94a0..6c1e55f 100644
--- a/lib/fdopendir.c
+++ b/lib/fdopendir.c
@@ -62,6 +62,23 @@ static DIR *fd_clone_opendir (int, struct saved_cwd const *);
    If this function returns successfully, FD is under control of the
    dirent.h system, and the caller should not close or modify the state of
    FD other than by the dirent.h functions.  */
+# ifdef __KLIBC__
+#  include <InnoTekLIBC/backend.h>
+
+DIR *
+fdopendir (int fd)
+{
+  char path[_MAX_PATH];
+
+  /* Get a path from fd */
+  if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
+    return NULL;
+
+  /* FIXME: close() fd explicitly after closedir(), or fd leaks */
+
+  return opendir (path);
+}
+# else
 DIR *
 fdopendir (int fd)
 {
@@ -84,6 +101,7 @@ fdopendir (int fd)
 
   return dir;
 }
+# endif
 
 /* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
    to be a dup of FD which is less than FD - 1 and which will be
-- 
1.8.5.2

Reply via email to