[syslinux:master] Fix COM32 chdir()

syslinux-bot for Gene Cumm gene.cumm at gmail.com
Sat Jun 26 12:36:28 PDT 2010


Commit-ID:  29d560e6bb11bc4a9171e1e70c9f282bf7cb6895
Gitweb:     http://syslinux.zytor.com/commit/29d560e6bb11bc4a9171e1e70c9f282bf7cb6895
Author:     Gene Cumm <gene.cumm at gmail.com>
AuthorDate: Sat, 26 Jun 2010 11:18:59 -0400
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Sat, 26 Jun 2010 12:31:28 -0700

Fix COM32 chdir()

Fix COM32 chdir() since it's implemented in the core.
Forgot the core changes needed for this before.

Signed-off-by: Gene Cumm <gene.cumm at gmail.com>
Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 com32/include/syslinux/pmapi.h |    2 ++
 com32/lib/chdir.c              |   10 ++++------
 core/pmapi.c                   |    2 ++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/com32/include/syslinux/pmapi.h b/com32/include/syslinux/pmapi.h
index ae3254d..f1036df 100644
--- a/com32/include/syslinux/pmapi.h
+++ b/com32/include/syslinux/pmapi.h
@@ -67,6 +67,8 @@ struct com32_pmapi {
 
     void (*idle)(void);
     void (*reset_idle)(void);
+
+    int (*chdir)(const char *);
 };
 
 #endif /* _SYSLINUX_PMAPI_H */
diff --git a/com32/lib/chdir.c b/com32/lib/chdir.c
index 6a365f3..00670e3 100644
--- a/com32/lib/chdir.c
+++ b/com32/lib/chdir.c
@@ -6,12 +6,10 @@
 #include <stdio.h>
 #include <errno.h>
 
+#include <com32.h>
+#include <syslinux/pmapi.h>
+
 int chdir(const char *path)
 {
-    /* Actually implement something here... */
-
-    (void)path;
-    
-    errno = ENOSYS;
-    return -1;
+    return __com32.cs_pm->chdir(path);
 }
diff --git a/core/pmapi.c b/core/pmapi.c
index f3a0c16..18693d9 100644
--- a/core/pmapi.c
+++ b/core/pmapi.c
@@ -34,4 +34,6 @@ const struct com32_pmapi pm_api_vector =
 
     .idle	= __idle,
     .reset_idle	= reset_idle,
+
+    .chdir	= chdir,
 };



More information about the Syslinux-commits mailing list