fcfec7dec3
compiling with _POSIX_SOURCE set (size_t doesn't get defined). Fix errno. Fix an incorrect va_arg: short gets promoted to int, so use that.
42 lines
1.5 KiB
Text
42 lines
1.5 KiB
Text
$NetBSD: patch-ak,v 1.2 2006/01/15 19:20:59 joerg Exp $
|
|
|
|
--- msdos/mfs_fileio.c.orig 2001-01-14 04:19:38.000000000 +0100
|
|
+++ msdos/mfs_fileio.c
|
|
@@ -32,6 +32,7 @@ To send email to the maintainer of the W
|
|
|
|
#include "platform.h"
|
|
|
|
+#include <errno.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <unistd.h> /* unlink() */
|
|
@@ -213,8 +214,8 @@ mfs_delete(DWORD p1, DWORD p2, DWORD p3,
|
|
(strcmp(filename, xdos.fileio[slot].filename) == 0) ) {
|
|
/* Get the handle */
|
|
if ((handle = gethandle()) < 0) {
|
|
- ERRSTR((LF_ERROR,"mfs_delete cannot get handle for file %s %d
|
|
- %d\n", filename, errno, slot));
|
|
+ ERRSTR((LF_ERROR,"mfs_delete cannot get handle for file %s %d"
|
|
+" %d\n", filename, errno, slot));
|
|
return MAKELONG(NO_HANDLES & 0xffff,0xffff);
|
|
}
|
|
xdos.fileptr[handle] = &xdos.fileio[slot];
|
|
@@ -232,8 +233,8 @@ mfs_delete(DWORD p1, DWORD p2, DWORD p3,
|
|
return unlink(filename);
|
|
}
|
|
}
|
|
- else ERRSTR((LF_ERROR,"mfs_delete : invalid handle %d for file
|
|
-%s\n",handle, filename));
|
|
+ else ERRSTR((LF_ERROR,"mfs_delete : invalid handle %d for file "
|
|
+"%s\n",handle, filename));
|
|
}
|
|
}
|
|
/* At this point, either the file was fclosed by us, or it was
|
|
@@ -332,7 +333,6 @@ mfs_openfile(char *filename, int mode, c
|
|
{
|
|
char altname[_MAX_PATH];
|
|
int slot,handle,freeslot;
|
|
- extern int errno;
|
|
int drive;
|
|
int fd;
|
|
int nclosed;
|