From dc528617dc33dfaccb5285f327eac98ed56786b6 Mon Sep 17 00:00:00 2001 From: Robert de Bath Date: Mon, 21 May 2001 14:51:52 +0200 Subject: Import Dev86src-0.15.6.tar.gz --- libc/Makefile | 2 +- libc/bios/Makefile | 2 +- libc/bios/bios.c | 15 --------------- libc/bios/fileops.c | 16 +++++++++++++--- 4 files changed, 15 insertions(+), 20 deletions(-) (limited to 'libc') 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; -- cgit v1.2.1