summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2001-05-21 14:51:52 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:47:38 +0200
commitdc528617dc33dfaccb5285f327eac98ed56786b6 (patch)
treeddc21e12ef005e69d5eb8c3e5a4624421a4dbc3d /libc
parent6d269edda0f49741484c1da6c71d24c031abc9ce (diff)
downloaddev86-dc528617dc33dfaccb5285f327eac98ed56786b6.tar.gz
Import Dev86src-0.15.6.tar.gzv0.15.6
Diffstat (limited to 'libc')
-rw-r--r--libc/Makefile2
-rw-r--r--libc/bios/Makefile2
-rw-r--r--libc/bios/bios.c15
-rw-r--r--libc/bios/fileops.c16
4 files changed, 15 insertions, 20 deletions
diff --git a/libc/Makefile b/libc/Makefile
index 408d92c..bf9754e 100644
--- a/libc/Makefile
+++ b/libc/Makefile
@@ -11,7 +11,7 @@ endif
VERMAJOR=0
VERMINOR=15
-VERPATCH=5
+VERPATCH=6
VER=$(VERMAJOR).$(VERMINOR).$(VERPATCH)
CC=bcc
diff --git a/libc/bios/Makefile b/libc/bios/Makefile
index 8436846..116776e 100644
--- a/libc/bios/Makefile
+++ b/libc/bios/Makefile
@@ -5,7 +5,7 @@
ifeq ($(LIB_OS),BIOS)
ASRC=bios.c
AOBJ=bios_start.o bios_isatty.o bios_nofiles.o \
- bios_open.o bios_read.o bios_write.o bios_lseek.o bios_close.o
+ bios_read.o bios_write.o bios_lseek.o bios_close.o
BSRC=bios_vid.c
BOBJ=bios_putc.o bios_getc.o bios_khit.o bios_rdline.o
diff --git a/libc/bios/bios.c b/libc/bios/bios.c
index 2290472..402f689 100644
--- a/libc/bios/bios.c
+++ b/libc/bios/bios.c
@@ -211,21 +211,6 @@ int fd;
/****************************************************************************/
-#ifdef L_bios_open
-extern int __fileops();
-
-open(name, flags, mode)
-char * name;
-int flags, mode;
-{
- __files = __fileops;
- return (*__files)(CMD_OPEN, flags, name, mode);
-}
-
-#endif
-
-/****************************************************************************/
-
#endif
#endif
#endif
diff --git a/libc/bios/fileops.c b/libc/bios/fileops.c
index 5c71a37..9c2daf5 100644
--- a/libc/bios/fileops.c
+++ b/libc/bios/fileops.c
@@ -11,9 +11,19 @@ static int op_close();
static int op_read();
static int op_write();
static long op_lseek();
+static int fileops();
int
-__fileops(cmd, fd, buf, len)
+open(name, flags, mode)
+char * name;
+int flags, mode;
+{
+ __files = fileops;
+ return (*__files)(CMD_OPEN, flags, name, mode);
+}
+
+static int
+fileops(cmd, fd, buf, len)
int cmd, fd, len;
char * buf;
{
@@ -48,7 +58,7 @@ char * buf;
int amount_left_in_buffer;
int amount_to_copy;
- if (fd >= MAX_OPEN_FILES || _iob[fd].block_read == 0)
+ if (fd < 0 || fd >= MAX_OPEN_FILES || _iob[fd].block_read == 0)
{
errno = EBADF;
return -1;
@@ -147,7 +157,7 @@ static int
op_close(fd)
int fd;
{
- if (fd >= MAX_OPEN_FILES || _iob[0].flags == 0)
+ if (fd < 0 || fd >= MAX_OPEN_FILES || _iob[0].flags == 0)
{
errno = EBADF;
return -1;