From ac888cf8ada81fe577ba3da053be3379b85b6499 Mon Sep 17 00:00:00 2001 From: solar Date: Tue, 16 May 2006 05:40:47 +0000 Subject: [PATCH] Wrong type for open() parameter; fixed. Added _PDCLIB_NOHANDLE to _PDCLIB_config.h. --- internals/_PDCLIB_glue.h | 2 +- platform/example/functions/_PDCLIB/open.c | 2 +- platform/example/internals/_PDCLIB_config.h | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internals/_PDCLIB_glue.h b/internals/_PDCLIB_glue.h index 94da07f..0ffbebc 100644 --- a/internals/_PDCLIB_glue.h +++ b/internals/_PDCLIB_glue.h @@ -33,7 +33,7 @@ void * _PDCLIB_allocpages( int n ); /* A system call that opens a file identified by name in a given mode, and returns a file descriptor uniquely identifying that file. */ -_PDCLIB_fd_t _PDCLIB_open( char const * const filename, int mode ); +_PDCLIB_fd_t _PDCLIB_open( char const * const filename, unsigned int mode ); /* A system call that writes n characters to a file identified by given file descriptor. Return the number of characters written. diff --git a/platform/example/functions/_PDCLIB/open.c b/platform/example/functions/_PDCLIB/open.c index e1fcc9d..b0b26cb 100644 --- a/platform/example/functions/_PDCLIB/open.c +++ b/platform/example/functions/_PDCLIB/open.c @@ -20,7 +20,7 @@ #include #include -_PDCLIB_fd_t _PDCLIB_open( char const * const filename, int mode ) +_PDCLIB_fd_t _PDCLIB_open( char const * const filename, unsigned int mode ) { int osmode = 0; if ( mode & _PDCLIB_FRW ) osmode |= O_RDWR; diff --git a/platform/example/internals/_PDCLIB_config.h b/platform/example/internals/_PDCLIB_config.h index 7d0933c..5c7210a 100644 --- a/platform/example/internals/_PDCLIB_config.h +++ b/platform/example/internals/_PDCLIB_config.h @@ -229,6 +229,11 @@ typedef char * _PDCLIB_va_list; /* The unique file descriptor returned by _PDCLIB_open(). */ typedef int _PDCLIB_fd_t; +/* The value (of type _PDCLIB_fd_t) returned by _PDCLIB_open() if the operation + failed. +*/ +#define _PDCLIB_NOHANDLE -1 + /* A type in which to store file offsets. See fgetpos() / fsetpos(). */ typedef struct { -- 2.40.0