]> pd.if.org Git - pdclib/commitdiff
Wrong type for open() parameter; fixed. Added _PDCLIB_NOHANDLE to _PDCLIB_config.h.
authorsolar <unknown>
Tue, 16 May 2006 05:40:47 +0000 (05:40 +0000)
committersolar <unknown>
Tue, 16 May 2006 05:40:47 +0000 (05:40 +0000)
internals/_PDCLIB_glue.h
platform/example/functions/_PDCLIB/open.c
platform/example/internals/_PDCLIB_config.h

index 94da07fd953a4aed1c0891baafab93777e740748..0ffbebc7eb6b97a1fa0d89e488ff5f6dde826931 100644 (file)
@@ -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.
index e1fcc9d6cd01826f82e8c4bb24ccc0fcc073b304..b0b26cb582c0dd0360e069a216f5d2a12f4e0e09 100644 (file)
@@ -20,7 +20,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-_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;
index 7d0933c9578dc11cfb6b35ace013934220ea3300..5c7210ad763c693b47cb0d8d693f2cf370eadb0c 100644 (file)
@@ -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
 {