openmem: fix openmem() syslinux-4.00-pre11
authorH. Peter Anvin <hpa@zytor.com>
Mon, 25 Jan 2010 23:00:38 +0000 (15:00 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 25 Jan 2010 23:00:38 +0000 (15:00 -0800)
Correct the implementation of openmem().

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/lib/sys/openmem.c

index 13a45c2..33b8de0 100644 (file)
@@ -42,7 +42,6 @@ const struct input_dev __file_dev;
 
 int openmem(const void *base, size_t len, int flags)
 {
-    com32sys_t regs;
     int fd;
     struct file_info *fp;
 
@@ -51,6 +50,8 @@ int openmem(const void *base, size_t len, int flags)
     if (fd < 0)
        return -1;
 
+    fp = &__file_info[fd];
+
     fp->i.length  = fp->i.nbytes = len;
     fp->i.datap   = (void *)base;
     fp->i.filedes = 0;         /* No actual file */