mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Changed how error conditions raised by dos.library file I/O functions
are detected. - Modified function return values of 0 and -1 to use macros like OK, ERROR/SEEK_ERROR instead, to better convey what the purpose of these values is. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14922 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: dirent_closedir.c,v 1.12 2005-03-18 12:38:22 obarthel Exp $
|
||||
* $Id: dirent_closedir.c,v 1.13 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -145,7 +145,7 @@ int
|
||||
closedir(DIR * directory_pointer)
|
||||
{
|
||||
struct DirectoryHandle * dh;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -204,7 +204,7 @@ closedir(DIR * directory_pointer)
|
||||
|
||||
free(dh);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_close.c,v 1.11 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: fcntl_close.c,v 1.12 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@ close(int file_descriptor)
|
||||
{
|
||||
struct file_action_message fam;
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -78,7 +78,7 @@ close(int file_descriptor)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_creat.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_creat.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
creat(const char * path_name, mode_t mode)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_fcntl.c,v 1.16 2005-04-04 10:09:56 obarthel Exp $
|
||||
* $Id: fcntl_fcntl.c,v 1.17 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -47,7 +47,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
struct file_action_message fam;
|
||||
struct flock * l;
|
||||
int vacant_slot;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
struct fd * fd = NULL;
|
||||
va_list arg;
|
||||
int error;
|
||||
@ -130,7 +130,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
|
||||
@ -144,7 +144,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_ASYNC_IO))
|
||||
SET_FLAG(result,O_ASYNC);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
|
||||
@ -205,7 +205,7 @@ fcntl(int file_descriptor, int cmd, ... /* int arg */ )
|
||||
CLEAR_FLAG(fd->fd_Flags,FDF_ASYNC_IO);
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_get_default_file.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: fcntl_get_default_file.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@ int
|
||||
__get_default_file(int file_descriptor,long * file_ptr)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
assert( file_descriptor >= 0 && file_descriptor < __num_fd );
|
||||
assert( __fd[file_descriptor] != NULL );
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_lseek.c,v 1.7 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: fcntl_lseek.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@ off_t
|
||||
lseek(int file_descriptor, off_t offset, int mode)
|
||||
{
|
||||
struct file_action_message fam;
|
||||
off_t result = -1;
|
||||
off_t result = SEEK_ERROR;
|
||||
off_t position;
|
||||
struct fd * fd;
|
||||
|
||||
@ -84,7 +84,7 @@ lseek(int file_descriptor, off_t offset, int mode)
|
||||
assert( fd->fd_Action != NULL );
|
||||
|
||||
position = (*fd->fd_Action)(fd,&fam);
|
||||
if(position < 0)
|
||||
if(position == EOF)
|
||||
{
|
||||
__set_errno(fam.fam_Error);
|
||||
goto out;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_open.c,v 1.15 2005-03-18 12:38:22 obarthel Exp $
|
||||
* $Id: fcntl_open.c,v 1.16 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -104,7 +104,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
int fd_slot_number;
|
||||
struct fd * fd;
|
||||
int access_mode;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
int i;
|
||||
|
||||
ENTER();
|
||||
@ -456,7 +456,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ )
|
||||
|
||||
handle = ZERO;
|
||||
|
||||
assert( result != -1 );
|
||||
assert( result != ERROR );
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_read.c,v 1.7 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: fcntl_read.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ ssize_t
|
||||
read(int file_descriptor, void * buffer, size_t num_bytes)
|
||||
{
|
||||
ssize_t num_bytes_read;
|
||||
ssize_t result = -1;
|
||||
ssize_t result = EOF;
|
||||
struct fd * fd;
|
||||
|
||||
ENTER();
|
||||
@ -110,7 +110,7 @@ read(int file_descriptor, void * buffer, size_t num_bytes)
|
||||
assert( fd->fd_Action != NULL );
|
||||
|
||||
num_bytes_read = (*fd->fd_Action)(fd,&fam);
|
||||
if(num_bytes_read < 0)
|
||||
if(num_bytes_read == EOF)
|
||||
{
|
||||
__set_errno(fam.fam_Error);
|
||||
goto out;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: fcntl_write.c,v 1.7 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: fcntl_write.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ ssize_t
|
||||
write(int file_descriptor, const void * buffer, size_t num_bytes)
|
||||
{
|
||||
ssize_t num_bytes_written;
|
||||
ssize_t result = -1;
|
||||
ssize_t result = EOF;
|
||||
struct fd * fd;
|
||||
|
||||
ENTER();
|
||||
@ -110,7 +110,7 @@ write(int file_descriptor, const void * buffer, size_t num_bytes)
|
||||
assert( fd->fd_Action != NULL );
|
||||
|
||||
num_bytes_written = (*fd->fd_Action)(fd,&fam);
|
||||
if(num_bytes_written < 0)
|
||||
if(num_bytes_written == EOF)
|
||||
{
|
||||
__set_errno(fam.fam_Error);
|
||||
goto out;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ftw_ftw.c,v 1.3 2005-03-18 12:38:22 obarthel Exp $
|
||||
* $Id: ftw_ftw.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -54,7 +54,7 @@
|
||||
static int
|
||||
walk(const char *path,int (*func)(const char *,const struct stat *,int),int depth,int level)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
@ -109,7 +109,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int),int dept
|
||||
dp = opendir(path); /* Also takes care of Unix->Amiga pathname conversion. */
|
||||
if(dp == NULL)
|
||||
{
|
||||
result = -1; /* Pass errno from opendir() */
|
||||
result = ERROR; /* Pass errno from opendir() */
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int),int dept
|
||||
{
|
||||
__set_errno(ENOMEM);
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int),int dept
|
||||
int
|
||||
ftw(const char *path,int (*func)(const char *,const struct stat *,int),int depth)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
char *base;
|
||||
int len;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: ftw_nftw.c,v 1.3 2005-03-18 12:38:22 obarthel Exp $
|
||||
* $Id: ftw_nftw.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,7 @@
|
||||
static int
|
||||
walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FTW *),const int depth,int level,const int flags,const int base,int * const prune)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
DIR *dp;
|
||||
struct dirent *de;
|
||||
struct stat st;
|
||||
@ -131,7 +131,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
dp = opendir(path); /* Also takes care of Unix->Amiga pathname conversion. */
|
||||
if(dp == NULL)
|
||||
{
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
{
|
||||
__set_errno(ENOMEM);
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
{
|
||||
__set_errno(ENOMEM);
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ walk(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
static int
|
||||
index_of_end_part(const char *path)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
int i;
|
||||
|
||||
i = strlen(path) - 1;
|
||||
@ -241,7 +241,7 @@ nftw(const char *path,int (*func)(const char *,const struct stat *,int,struct FT
|
||||
int len;
|
||||
int base_index;
|
||||
int prune = 0;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: locale_init_exit.c,v 1.12 2005-03-18 12:38:22 obarthel Exp $
|
||||
* $Id: locale_init_exit.c,v 1.13 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -139,7 +139,7 @@ __locale_exit(void)
|
||||
int
|
||||
__locale_init(void)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -174,7 +174,7 @@ __locale_init(void)
|
||||
}
|
||||
|
||||
if(__default_locale != NULL)
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
__locale_unlock();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: mount_fstatfs.c,v 1.10 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: mount_fstatfs.c,v 1.11 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -52,7 +52,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
|
||||
{
|
||||
D_S(struct InfoData,id);
|
||||
BPTR parent_dir = ZERO;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
struct fd * fd = NULL;
|
||||
LONG success;
|
||||
|
||||
@ -129,7 +129,7 @@ fstatfs(int file_descriptor, struct statfs *buf)
|
||||
|
||||
__convert_info_to_statfs(id,buf);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: mount_statfs.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: mount_statfs.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -56,7 +56,7 @@ statfs(const char *path, struct statfs *buf)
|
||||
D_S(struct InfoData,id);
|
||||
LONG status;
|
||||
BPTR lock = ZERO;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -105,7 +105,7 @@ statfs(const char *path, struct statfs *buf)
|
||||
buf->f_bavail = buf->f_bfree;
|
||||
buf->f_flags = MNT_NOATIME|MNT_SYMPERM|MNT_LOCAL|MNT_RDONLY;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
goto out;
|
||||
}
|
||||
@ -141,7 +141,7 @@ statfs(const char *path, struct statfs *buf)
|
||||
|
||||
__convert_info_to_statfs(id,buf);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: sas_profile.c,v 1.5 2005-03-18 12:38:22 obarthel Exp $
|
||||
* $Id: sas_profile.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -117,7 +117,7 @@ send_profiler_message(ULONG clock_value,char * id,ULONG flags)
|
||||
extern long __builtin_getreg(int);
|
||||
|
||||
struct SPROFMSG * spm;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
spm = (struct SPROFMSG *)GetMsg(reply_port);
|
||||
if(spm != NULL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_kill.c,v 1.5 2005-03-27 10:02:50 obarthel Exp $
|
||||
* $Id: signal_kill.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -44,7 +44,7 @@
|
||||
int
|
||||
kill(pid_t pid, int signal_number)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -85,7 +85,7 @@ kill(pid_t pid, int signal_number)
|
||||
SHOWMSG("but won't shut it down");
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_raise.c,v 1.7 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: signal_raise.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -62,7 +62,7 @@ raise(int sig)
|
||||
{
|
||||
static int local_signals_blocked;
|
||||
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -137,7 +137,7 @@ raise(int sig)
|
||||
SHOWMSG("that signal is blocked");
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_sigaddset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_sigaddset.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
sigaddset(sigset_t * set,int sig)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -68,7 +68,7 @@ sigaddset(sigset_t * set,int sig)
|
||||
|
||||
(*set) |= sigmask(sig);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_sigemptyset.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_sigemptyset.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
sigemptyset(sigset_t * set)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -68,7 +68,7 @@ sigemptyset(sigset_t * set)
|
||||
|
||||
(*set) = 0;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_sigmask.c,v 1.3 2005-01-02 09:07:07 obarthel Exp $
|
||||
* $Id: signal_sigmask.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -53,7 +53,7 @@ sigmask(int sig)
|
||||
assert( 0 <= sig && sig <= 31 );
|
||||
|
||||
if(SIGABRT <= sig && sig <= SIGTERM)
|
||||
result = (1<<sig);
|
||||
result = (1 << sig);
|
||||
else
|
||||
result = 0;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: signal_sigprocmask.c,v 1.4 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: signal_sigprocmask.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -44,7 +44,7 @@
|
||||
int
|
||||
sigprocmask(int how, const sigset_t *set, sigset_t *oset)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -92,7 +92,7 @@ sigprocmask(int how, const sigset_t *set, sigset_t *oset)
|
||||
}
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_accept.c,v 1.10 2005-03-09 12:06:10 obarthel Exp $
|
||||
* $Id: socket_accept.c,v 1.11 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -54,7 +54,7 @@ accept(int sockfd,struct sockaddr *cliaddr,int *addrlen)
|
||||
struct fd * fd = NULL;
|
||||
struct fd * new_fd;
|
||||
int new_fd_slot_number;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
LONG new_socket_fd;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_bind.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_bind.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
bind(int sockfd,struct sockaddr *name,int namelen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_connect.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_connect.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
connect(int sockfd,struct sockaddr *name,int namelen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_gethostname.c,v 1.3 2005-02-03 16:56:15 obarthel Exp $
|
||||
* $Id: socket_gethostname.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
gethostname(const char *hostname,int size)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getpeername.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_getpeername.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
getpeername(int sockfd,struct sockaddr *name,int *namelen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getsockname.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_getsockname.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
getsockname(int sockfd,struct sockaddr *name,int *namelen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_getsockopt.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_getsockopt.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
getsockopt(int sockfd,int level,int optname,void *optval,int *optlen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_hook_entry.c,v 1.14 2005-04-04 10:09:56 obarthel Exp $
|
||||
* $Id: socket_hook_entry.c,v 1.15 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -111,7 +111,7 @@ __socket_hook_entry(
|
||||
|
||||
SHOWMSG("file_action_close");
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
/* If this is an alias, just remove it. */
|
||||
is_aliased = __fd_is_aliased(fd);
|
||||
@ -151,7 +151,7 @@ __socket_hook_entry(
|
||||
|
||||
SHOWMSG("file_action_seek");
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
|
||||
fam->fam_Error = ESPIPE;
|
||||
|
||||
@ -195,7 +195,7 @@ __socket_hook_entry(
|
||||
DateStamp(&fib->fib_Date);
|
||||
PROFILE_ON();
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
|
||||
@ -203,7 +203,7 @@ __socket_hook_entry(
|
||||
|
||||
SHOWVALUE(fam->fam_Action);
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
|
||||
fam->fam_Error = EBADF;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_ioctl.c,v 1.7 2005-02-28 13:22:53 obarthel Exp $
|
||||
* $Id: socket_ioctl.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -57,7 +57,7 @@ ioctl(int sockfd,unsigned long request, ... /* char *arg */)
|
||||
va_list arg;
|
||||
char * param;
|
||||
struct fd * fd = NULL;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_listen.c,v 1.3 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_listen.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@ int
|
||||
listen(int sockfd,int backlog)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_recv.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_recv.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
recv(int sockfd,void *buff,size_t nbytes,int flags)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_recvfrom.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_recvfrom.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
recvfrom(int sockfd,void *buff,int len,int flags,struct sockaddr *from,int *fromlen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_recvmsg.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_recvmsg.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
recvmsg(int sockfd,struct msghdr *msg,int flags)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_select.c,v 1.10 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: socket_select.c,v 1.11 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -495,7 +495,7 @@ select(int num_fds,fd_set *read_fds,fd_set *write_fds,fd_set *except_fds,struct
|
||||
int total_file_fd;
|
||||
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
int num_socket_used;
|
||||
int num_file_used;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_send.c,v 1.6 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: socket_send.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
send(int sockfd,const void *buff,size_t nbytes,int flags)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_sendmsg.c,v 1.4 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_sendmsg.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
sendmsg(int sockfd,struct msghdr *msg,int flags)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_sendto.c,v 1.6 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: socket_sendto.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
sendto(int sockfd,const void *buff,int len,int flags,struct sockaddr *to,int tolen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_setsockopt.c,v 1.6 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: socket_setsockopt.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
setsockopt(int sockfd,int level,int optname,const void *optval,int optlen)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_shutdown.c,v 1.3 2005-02-18 18:53:16 obarthel Exp $
|
||||
* $Id: socket_shutdown.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@ int
|
||||
shutdown(int sockfd, int how)
|
||||
{
|
||||
struct fd * fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: socket_socket.c,v 1.8 2005-03-09 12:06:10 obarthel Exp $
|
||||
* $Id: socket_socket.c,v 1.9 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@ int
|
||||
socket(int domain,int type,int protocol)
|
||||
{
|
||||
struct SignalSemaphore * lock = NULL;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
struct fd * fd;
|
||||
int fd_slot_number;
|
||||
LONG socket_fd;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_chmod.c,v 1.5 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: stat_chmod.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -55,7 +55,7 @@ chmod(const char * path_name, mode_t mode)
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
ULONG protection;
|
||||
LONG status;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -146,7 +146,7 @@ chmod(const char * path_name, mode_t mode)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_fchmod.c,v 1.9 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: stat_fchmod.c,v 1.10 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -49,7 +49,7 @@ fchmod(int file_descriptor, mode_t mode)
|
||||
BPTR parent_dir = ZERO;
|
||||
BPTR old_current_dir = ZERO;
|
||||
BOOL current_dir_changed = FALSE;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
struct fd * fd = NULL;
|
||||
LONG success;
|
||||
|
||||
@ -163,7 +163,7 @@ fchmod(int file_descriptor, mode_t mode)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_fstat.c,v 1.7 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: stat_fstat.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -52,7 +52,7 @@ fstat(int file_descriptor, struct stat * buffer)
|
||||
{
|
||||
struct file_action_message fam;
|
||||
D_S(struct FileInfoBlock,fib);
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
struct fd * fd;
|
||||
|
||||
ENTER();
|
||||
@ -104,7 +104,7 @@ fstat(int file_descriptor, struct stat * buffer)
|
||||
|
||||
__convert_file_info_to_stat(fam.fam_FileSystem,fib,buffer);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_lstat.c,v 1.9 2005-04-03 10:22:47 obarthel Exp $
|
||||
* $Id: stat_lstat.c,v 1.10 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -174,7 +174,7 @@ lstat(const char * path_name, struct stat * st)
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
D_S(struct FileInfoBlock,fib);
|
||||
struct FileLock * fl;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
LONG status;
|
||||
BPTR file_lock = ZERO;
|
||||
int link_length = -1;
|
||||
@ -227,7 +227,7 @@ lstat(const char * path_name, struct stat * st)
|
||||
st->st_nlink = 2;
|
||||
st->st_blksize = 512;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
goto out;
|
||||
}
|
||||
@ -288,7 +288,7 @@ lstat(const char * path_name, struct stat * st)
|
||||
__convert_file_info_to_stat(fl->fl_Task,fib,st);
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_mkdir.c,v 1.5 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: stat_mkdir.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -54,7 +54,7 @@ mkdir(const char * path_name, mode_t mode)
|
||||
struct name_translation_info path_name_nti;
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
ULONG protection;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
BPTR dir_lock;
|
||||
|
||||
ENTER();
|
||||
@ -158,7 +158,7 @@ mkdir(const char * path_name, mode_t mode)
|
||||
SetProtection((STRPTR)path_name,(LONG)(protection ^ (FIBF_READ|FIBF_WRITE|FIBF_EXECUTE|FIBF_DELETE)));
|
||||
PROFILE_ON();
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_rmdir.c,v 1.5 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: stat_rmdir.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -55,7 +55,7 @@ rmdir(const char * path_name)
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
D_S(struct FileInfoBlock,fib);
|
||||
BPTR dir_lock = ZERO;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
LONG status;
|
||||
|
||||
ENTER();
|
||||
@ -149,7 +149,7 @@ rmdir(const char * path_name)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stat_stat.c,v 1.7 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: stat_stat.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -63,7 +63,7 @@ stat(const char * path_name, struct stat * st)
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
D_S(struct FileInfoBlock,fib);
|
||||
struct FileLock * fl;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
LONG status;
|
||||
BPTR file_lock = ZERO;
|
||||
|
||||
@ -121,7 +121,8 @@ stat(const char * path_name, struct stat * st)
|
||||
st->st_nlink = 2;
|
||||
st->st_blksize = 512;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@ -158,7 +159,7 @@ stat(const char * path_name, struct stat * st)
|
||||
|
||||
__convert_file_info_to_stat(fl->fl_Task,fib,st);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_asprintf.c,v 1.5 2005-02-28 10:07:30 obarthel Exp $
|
||||
* $Id: stdio_asprintf.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
asprintf(char **ret, const char *format, ...)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
va_list arg;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_dropiobreadbuffer.c,v 1.6 2005-02-21 10:21:44 obarthel Exp $
|
||||
* $Id: stdio_dropiobreadbuffer.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@
|
||||
int
|
||||
__drop_iob_read_buffer(struct iob * file)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -83,11 +83,11 @@ __drop_iob_read_buffer(struct iob * file)
|
||||
|
||||
assert( file->iob_Action != NULL );
|
||||
|
||||
if((*file->iob_Action)(file,&fam) < 0)
|
||||
if((*file->iob_Action)(file,&fam) == EOF)
|
||||
{
|
||||
SHOWMSG("that didn't work");
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
|
||||
SET_FLAG(file->iob_Flags,IOBF_ERROR);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fclose.c,v 1.10 2005-03-18 12:38:23 obarthel Exp $
|
||||
* $Id: stdio_fclose.c,v 1.11 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -54,7 +54,7 @@ fclose(FILE *stream)
|
||||
{
|
||||
struct iob * file = (struct iob *)stream;
|
||||
struct file_action_message fam;
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fdhookentry.c,v 1.28 2005-04-04 10:09:57 obarthel Exp $
|
||||
* $Id: stdio_fdhookentry.c,v 1.29 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -64,7 +64,7 @@ __fd_hook_entry(
|
||||
off_t new_position;
|
||||
int new_mode;
|
||||
char * buffer = NULL;
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
BOOL is_aliased;
|
||||
BPTR file;
|
||||
|
||||
@ -164,7 +164,7 @@ __fd_hook_entry(
|
||||
|
||||
PROFILE_ON();
|
||||
|
||||
if(result < 0)
|
||||
if(result == -1)
|
||||
{
|
||||
D(("read failed ioerr=%ld",IoErr()));
|
||||
|
||||
@ -173,7 +173,7 @@ __fd_hook_entry(
|
||||
}
|
||||
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_CACHE_POSITION))
|
||||
fd->fd_Position += result;
|
||||
fd->fd_Position += (ULONG)result;
|
||||
|
||||
break;
|
||||
|
||||
@ -193,7 +193,7 @@ __fd_hook_entry(
|
||||
PROFILE_OFF();
|
||||
|
||||
position = Seek(file,0,OFFSET_END);
|
||||
if(position >= 0)
|
||||
if(position != SEEK_ERROR)
|
||||
{
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_CACHE_POSITION))
|
||||
fd->fd_Position = Seek(file,0,OFFSET_CURRENT);
|
||||
@ -201,7 +201,7 @@ __fd_hook_entry(
|
||||
|
||||
PROFILE_ON();
|
||||
|
||||
if(position < 0)
|
||||
if(position == SEEK_ERROR)
|
||||
{
|
||||
D(("seek to end of file failed; ioerr=%ld",IoErr()));
|
||||
|
||||
@ -218,7 +218,7 @@ __fd_hook_entry(
|
||||
|
||||
PROFILE_ON();
|
||||
|
||||
if(result < 0)
|
||||
if(result == -1)
|
||||
{
|
||||
D(("write failed ioerr=%ld",IoErr()));
|
||||
|
||||
@ -227,7 +227,7 @@ __fd_hook_entry(
|
||||
}
|
||||
|
||||
if(FLAG_IS_SET(fd->fd_Flags,FDF_CACHE_POSITION))
|
||||
fd->fd_Position += result;
|
||||
fd->fd_Position += (ULONG)result;
|
||||
|
||||
break;
|
||||
|
||||
@ -236,7 +236,7 @@ __fd_hook_entry(
|
||||
SHOWMSG("file_action_close");
|
||||
|
||||
/* The following is almost guaranteed not to fail. */
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
/* If this is an alias, just remove it. */
|
||||
is_aliased = __fd_is_aliased(fd);
|
||||
@ -278,7 +278,7 @@ __fd_hook_entry(
|
||||
{
|
||||
fam->fam_Error = __translate_io_error_to_errno(IoErr());
|
||||
|
||||
result = -1;
|
||||
result = EOF;
|
||||
}
|
||||
|
||||
PROFILE_ON();
|
||||
@ -452,7 +452,7 @@ __fd_hook_entry(
|
||||
current_position = Seek(file,0,OFFSET_CURRENT);
|
||||
PROFILE_ON();
|
||||
|
||||
if(current_position < 0)
|
||||
if(current_position == SEEK_ERROR)
|
||||
{
|
||||
fam->fam_Error = EBADF;
|
||||
goto out;
|
||||
@ -493,7 +493,7 @@ __fd_hook_entry(
|
||||
position = Seek(file,fam->fam_Offset,new_mode);
|
||||
PROFILE_ON();
|
||||
|
||||
if(position < 0)
|
||||
if(position == SEEK_ERROR)
|
||||
{
|
||||
D(("seek failed, fam->fam_Mode=%ld (%ld), offset=%ld, ioerr=%ld",new_mode,fam->fam_Mode,fam->fam_Offset,IoErr()));
|
||||
|
||||
@ -553,7 +553,7 @@ __fd_hook_entry(
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -608,7 +608,7 @@ __fd_hook_entry(
|
||||
|
||||
fam->fam_FileSystem = fh->fh_Type;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fflush.c,v 1.7 2005-04-04 11:56:22 obarthel Exp $
|
||||
* $Id: stdio_fflush.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -134,7 +134,7 @@ fflush(FILE *stream)
|
||||
}
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fgetc.c,v 1.6 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: stdio_fgetc.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -84,7 +84,7 @@ int
|
||||
__fgetc_check(FILE * stream)
|
||||
{
|
||||
struct iob * file = (struct iob *)stream;
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( stream != NULL );
|
||||
|
||||
@ -122,7 +122,7 @@ __fgetc_check(FILE * stream)
|
||||
if(__iob_write_buffer_is_valid(file) && __flush_iob_write_buffer(file) < 0)
|
||||
goto out;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fgetpos.c,v 1.4 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_fgetpos.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -74,7 +74,7 @@ fgetpos(FILE *stream, fpos_t *pos)
|
||||
#endif /* CHECK_FOR_NULL_POINTERS */
|
||||
|
||||
position = ftell(stream);
|
||||
if(position == -1)
|
||||
if(position == SEEK_ERROR)
|
||||
{
|
||||
SHOWMSG("ftell() didn't work.");
|
||||
|
||||
@ -83,7 +83,7 @@ fgetpos(FILE *stream, fpos_t *pos)
|
||||
|
||||
(*pos) = position;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_file_init.c,v 1.8 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: stdio_file_init.c,v 1.9 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -124,7 +124,7 @@ FILE_DESTRUCTOR(workbench_exit)
|
||||
STATIC int
|
||||
wb_file_init(void)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
PROFILE_OFF();
|
||||
|
||||
@ -191,7 +191,7 @@ wb_file_init(void)
|
||||
|
||||
restore_streams = TRUE;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_filliobreadbuffer.c,v 1.9 2005-03-19 11:06:57 obarthel Exp $
|
||||
* $Id: stdio_filliobreadbuffer.c,v 1.10 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -42,7 +42,7 @@ __fill_iob_read_buffer(struct iob * file)
|
||||
{
|
||||
struct file_action_message fam;
|
||||
int num_bytes_read;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -72,7 +72,7 @@ __fill_iob_read_buffer(struct iob * file)
|
||||
assert( file->iob_Action != NULL );
|
||||
|
||||
num_bytes_read = (*file->iob_Action)(file,&fam);
|
||||
if(num_bytes_read < 0)
|
||||
if(num_bytes_read == EOF)
|
||||
{
|
||||
D(("got error %ld",fam.fam_Error));
|
||||
|
||||
@ -88,7 +88,7 @@ __fill_iob_read_buffer(struct iob * file)
|
||||
|
||||
SHOWVALUE(file->iob_BufferReadBytes);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_findvacantfdentry.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: stdio_findvacantfdentry.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -76,7 +76,7 @@ __is_valid_fd(struct fd * fd)
|
||||
int
|
||||
__find_vacant_fd_entry(void)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
int i;
|
||||
|
||||
assert( __fd != NULL || __num_fd == 0 );
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_findvacantiobentry.c,v 1.3 2005-02-27 21:58:21 obarthel Exp $
|
||||
* $Id: stdio_findvacantiobentry.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -73,7 +73,7 @@ __is_valid_iob(struct iob * iob)
|
||||
int
|
||||
__find_vacant_iob_entry(void)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
int i;
|
||||
|
||||
assert( __iob != NULL || __num_iob == 0 );
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_flush_all_files.c,v 1.1 2005-03-19 11:06:57 obarthel Exp $
|
||||
* $Id: stdio_flush_all_files.c,v 1.2 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -55,13 +55,13 @@ __flush_all_files(int buffer_mode)
|
||||
{
|
||||
if(__flush_iob_write_buffer(__iob[i]) < 0)
|
||||
{
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_flushiobwritebuffer.c,v 1.6 2005-02-21 10:21:48 obarthel Exp $
|
||||
* $Id: stdio_flushiobwritebuffer.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -45,7 +45,7 @@
|
||||
int
|
||||
__flush_iob_write_buffer(struct iob * file)
|
||||
{
|
||||
int result = 0;
|
||||
int result = OK;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -75,11 +75,11 @@ __flush_iob_write_buffer(struct iob * file)
|
||||
|
||||
assert( file->iob_Action != NULL );
|
||||
|
||||
if((*file->iob_Action)(file,&fam) < 0)
|
||||
if((*file->iob_Action)(file,&fam) == EOF)
|
||||
{
|
||||
SHOWMSG("that didn't work");
|
||||
|
||||
result = -1;
|
||||
result = ERROR;
|
||||
|
||||
SET_FLAG(file->iob_Flags,IOBF_ERROR);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fprintf.c,v 1.5 2005-03-24 15:31:16 obarthel Exp $
|
||||
* $Id: stdio_fprintf.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@
|
||||
int
|
||||
fprintf(FILE *stream,const char *format,...)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
va_list arg;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fputc.c,v 1.5 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_fputc.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -93,7 +93,7 @@ __fputc_check(FILE *stream)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fputs.c,v 1.5 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_fputs.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -90,7 +90,7 @@ fputs(const char *s, FILE *stream)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fseek.c,v 1.7 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_fseek.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -47,7 +47,7 @@ int
|
||||
fseek(FILE *stream, long int offset, int wherefrom)
|
||||
{
|
||||
struct iob * file = (struct iob *)stream;
|
||||
int result = -1;
|
||||
int result = SEEK_ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -175,7 +175,7 @@ fseek(FILE *stream, long int offset, int wherefrom)
|
||||
|
||||
assert( file->iob_Action != NULL );
|
||||
|
||||
if((*file->iob_Action)(file,&fam) < 0)
|
||||
if((*file->iob_Action)(file,&fam) == EOF)
|
||||
{
|
||||
SET_FLAG(file->iob_Flags,IOBF_ERROR);
|
||||
|
||||
@ -186,7 +186,7 @@ fseek(FILE *stream, long int offset, int wherefrom)
|
||||
}
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_fsetpos.c,v 1.5 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_fsetpos.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -78,7 +78,7 @@ fsetpos(FILE *stream, fpos_t *pos)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_ftell.c,v 1.7 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_ftell.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,7 +48,7 @@ ftell(FILE *stream)
|
||||
{
|
||||
struct iob * file = (struct iob *)stream;
|
||||
struct file_action_message fam;
|
||||
long int result = -1;
|
||||
long int result = ERROR;
|
||||
int position;
|
||||
|
||||
assert( stream != NULL );
|
||||
@ -97,7 +97,7 @@ ftell(FILE *stream)
|
||||
assert( file->iob_Action != NULL );
|
||||
|
||||
position = (*file->iob_Action)(file,&fam);
|
||||
if(position < 0)
|
||||
if(position == EOF)
|
||||
{
|
||||
SET_FLAG(file->iob_Flags,IOBF_ERROR);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_ftrylockfile.c,v 1.3 2005-02-28 13:42:52 obarthel Exp $
|
||||
* $Id: stdio_ftrylockfile.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -51,7 +51,7 @@ int
|
||||
ftrylockfile(FILE *stream)
|
||||
{
|
||||
struct iob * file = (struct iob *)stream;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -88,7 +88,7 @@ ftrylockfile(FILE *stream)
|
||||
if(file->iob_Lock != NULL && CANNOT AttemptSemaphore(file->iob_Lock))
|
||||
goto out;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_getc.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
|
||||
* $Id: stdio_getc.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
getc(FILE *stream)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( stream != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_getc_unlocked.c,v 1.1 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_getc_unlocked.c,v 1.2 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
getc_unlocked(FILE *stream)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( stream != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_getchar_unlocked.c,v 1.1 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_getchar_unlocked.c,v 1.2 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
getchar_unlocked(void)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( stdin != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_grow_file.c,v 1.3 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: stdio_grow_file.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -57,7 +57,7 @@ __grow_file_size(struct fd * fd,int num_bytes)
|
||||
int position;
|
||||
int current_position;
|
||||
int alignment_skip;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
assert( fd != NULL );
|
||||
|
||||
@ -107,7 +107,7 @@ __grow_file_size(struct fd * fd,int num_bytes)
|
||||
position = Seek(fd->fd_DefaultFile,0,OFFSET_END);
|
||||
PROFILE_ON();
|
||||
|
||||
if(position < 0)
|
||||
if(position == SEEK_ERROR)
|
||||
{
|
||||
SHOWMSG("could not move to the end of the file");
|
||||
goto out;
|
||||
@ -153,7 +153,7 @@ __grow_file_size(struct fd * fd,int num_bytes)
|
||||
|
||||
SHOWMSG("all done.");
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_growfdtable.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
|
||||
* $Id: stdio_growfdtable.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,7 +48,7 @@ __grow_fd_table(int max_fd)
|
||||
{
|
||||
const int granularity = 10;
|
||||
int new_num_fd;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
if(max_fd == 0)
|
||||
new_num_fd = __num_fd + granularity;
|
||||
@ -102,7 +102,7 @@ __grow_fd_table(int max_fd)
|
||||
__num_fd = new_num_fd;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_growiobtable.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
|
||||
* $Id: stdio_growiobtable.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,7 +48,7 @@ __grow_iob_table(int max_iob)
|
||||
{
|
||||
const int granularity = 10;
|
||||
int new_num_iob;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
if(max_iob == 0)
|
||||
new_num_iob = __num_iob + granularity;
|
||||
@ -102,7 +102,7 @@ __grow_iob_table(int max_iob)
|
||||
__num_iob = new_num_iob;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_headers.h,v 1.22 2005-04-02 13:25:53 obarthel Exp $
|
||||
* $Id: stdio_headers.h,v 1.23 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -383,7 +383,7 @@ struct fd
|
||||
struct fd * fd_NextLink; /* Points to next duplicate of this
|
||||
file descriptor; NULL for none */
|
||||
BPTR fd_DefaultFile; /* A dos.library file handle */
|
||||
LONG fd_Position; /* Cached file position (seek offset). */
|
||||
ULONG fd_Position; /* Cached file position (seek offset). */
|
||||
fd_cleanup_t fd_Cleanup; /* Cleanup function, if any. */
|
||||
|
||||
struct SignalSemaphore * fd_Lock; /* For thread locking */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_iobhookentry.c,v 1.5 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: stdio_iobhookentry.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -69,7 +69,7 @@ __iob_hook_entry(
|
||||
{
|
||||
fam->fam_Error = EBADF;
|
||||
|
||||
result = -1;
|
||||
result = EOF;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -86,7 +86,7 @@ __iob_hook_entry(
|
||||
|
||||
fam->fam_Error = EBADF;
|
||||
|
||||
result = -1;
|
||||
result = EOF;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_lock.c,v 1.3 2005-03-03 14:20:55 obarthel Exp $
|
||||
* $Id: stdio_lock.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -79,13 +79,13 @@ __stdio_lock_exit(void)
|
||||
int
|
||||
__stdio_lock_init(void)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
stdio_lock = __create_semaphore();
|
||||
if(stdio_lock == NULL)
|
||||
goto out;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_openiob.c,v 1.12 2005-03-18 12:38:23 obarthel Exp $
|
||||
* $Id: stdio_openiob.c,v 1.13 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,7 +48,7 @@ __open_iob(const char *filename, const char *mode, int file_descriptor, int slot
|
||||
{
|
||||
struct SignalSemaphore * lock;
|
||||
ULONG file_flags;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
int open_mode;
|
||||
struct fd * fd = NULL;
|
||||
STRPTR buffer = NULL;
|
||||
@ -198,7 +198,7 @@ __open_iob(const char *filename, const char *mode, int file_descriptor, int slot
|
||||
|
||||
buffer = NULL;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_popen.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
|
||||
* $Id: stdio_popen.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -56,7 +56,7 @@
|
||||
int
|
||||
pclose(FILE *stream)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -84,7 +84,7 @@ pclose(FILE *stream)
|
||||
/* ZZZ we actually could catch the program's termination code
|
||||
* by passing an exit function address to SystemTags() below.
|
||||
*/
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_printf.c,v 1.4 2005-02-28 10:07:31 obarthel Exp $
|
||||
* $Id: stdio_printf.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@
|
||||
int
|
||||
printf(const char *format, ...)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
va_list arg;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_putc.c,v 1.3 2005-02-03 16:56:16 obarthel Exp $
|
||||
* $Id: stdio_putc.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
putc(int c,FILE *stream)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( stream != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_putc_unlocked.c,v 1.1 2005-02-27 18:09:10 obarthel Exp $
|
||||
* $Id: stdio_putc_unlocked.c,v 1.2 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
putc_unlocked(int c,FILE *stream)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( stream != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_putchar_unlocked.c,v 1.1 2005-02-27 18:09:11 obarthel Exp $
|
||||
* $Id: stdio_putchar_unlocked.c,v 1.2 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
putchar_unlocked(int c)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( stdout != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_puts.c,v 1.6 2005-02-27 18:09:11 obarthel Exp $
|
||||
* $Id: stdio_puts.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -92,7 +92,7 @@ puts(const char *s)
|
||||
if(__putc('\n',stdout,buffer_mode) == EOF)
|
||||
goto out;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_record_locking.c,v 1.9 2005-04-01 18:46:37 obarthel Exp $
|
||||
* $Id: stdio_record_locking.c,v 1.10 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -1223,7 +1223,7 @@ __handle_record_locking(int cmd,struct flock * l,struct fd * fd,int * error_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_remove.c,v 1.4 2005-02-28 10:07:31 obarthel Exp $
|
||||
* $Id: stdio_remove.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@
|
||||
int
|
||||
remove(const char *filename)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -89,7 +89,7 @@ remove(const char *filename)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
}
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_rename.c,v 1.6 2005-04-21 10:23:17 obarthel Exp $
|
||||
* $Id: stdio_rename.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@ rename(const char *oldname,const char *newname)
|
||||
struct name_translation_info old_nti;
|
||||
struct name_translation_info new_nti;
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
LONG status;
|
||||
|
||||
ENTER();
|
||||
@ -145,7 +145,7 @@ rename(const char *oldname,const char *newname)
|
||||
#endif /* UNIX_PATH_SEMANTICS */
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_scanf.c,v 1.5 2005-04-03 10:22:47 obarthel Exp $
|
||||
* $Id: stdio_scanf.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@
|
||||
int
|
||||
scanf(const char *format, ...)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
va_list arg;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_setvbuf.c,v 1.7 2005-03-18 12:38:23 obarthel Exp $
|
||||
* $Id: stdio_setvbuf.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -186,7 +186,7 @@ setvbuf(FILE *stream,char *buf,int bufmode,size_t size)
|
||||
|
||||
new_buffer = NULL;
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_snprintf.c,v 1.4 2005-02-28 10:07:31 obarthel Exp $
|
||||
* $Id: stdio_snprintf.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@
|
||||
int
|
||||
snprintf(char *s, size_t size, const char *format, ...)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
va_list arg;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_sprintf.c,v 1.4 2005-02-28 10:07:31 obarthel Exp $
|
||||
* $Id: stdio_sprintf.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@
|
||||
int
|
||||
sprintf(char *s, const char *format, ...)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
va_list arg;
|
||||
|
||||
ENTER();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_sscanf_hook_entry.c,v 1.4 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: stdio_sscanf_hook_entry.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,7 +48,7 @@ __sscanf_hook_entry(
|
||||
struct iob * string_iob,
|
||||
struct file_action_message * fam)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
int num_bytes;
|
||||
|
||||
assert( fam != NULL && string_iob != NULL );
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_vasprintf_hook_entry.c,v 1.6 2005-03-19 10:15:56 obarthel Exp $
|
||||
* $Id: stdio_vasprintf_hook_entry.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -58,7 +58,7 @@ __vasprintf_hook_entry(
|
||||
struct iob * string_iob,
|
||||
struct file_action_message * fam)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
int num_bytes_left;
|
||||
int num_bytes;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_vprintf.c,v 1.4 2005-02-28 10:07:31 obarthel Exp $
|
||||
* $Id: stdio_vprintf.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -46,7 +46,7 @@
|
||||
int
|
||||
vprintf(const char *format,va_list arg)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_vsnprintf_hook_entry.c,v 1.6 2005-02-20 15:46:52 obarthel Exp $
|
||||
* $Id: stdio_vsnprintf_hook_entry.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,7 +48,7 @@ __vsnprintf_hook_entry(
|
||||
struct iob * string_iob,
|
||||
struct file_action_message * fam)
|
||||
{
|
||||
int result = -1;
|
||||
int result = EOF;
|
||||
|
||||
assert( fam != NULL && string_iob != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdio_vsprintf_hook_entry.c,v 1.3 2005-02-20 13:19:40 obarthel Exp $
|
||||
* $Id: stdio_vsprintf_hook_entry.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -48,7 +48,7 @@ __vsprintf_hook_entry(
|
||||
struct iob * string_iob,
|
||||
struct file_action_message * fam)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
assert( fam != NULL && string_iob != NULL );
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_atexit.c,v 1.4 2005-03-18 12:38:23 obarthel Exp $
|
||||
* $Id: stdlib_atexit.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -69,7 +69,7 @@ int
|
||||
atexit(void (*function)(void))
|
||||
{
|
||||
struct ExitTrapNode * etn;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
assert( function != NULL );
|
||||
|
||||
@ -114,7 +114,7 @@ atexit(void (*function)(void))
|
||||
|
||||
AddHead((struct List *)&exit_trap_list,(struct Node *)etn);
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_mkstemp.c,v 1.4 2005-02-03 16:56:16 obarthel Exp $
|
||||
* $Id: stdlib_mkstemp.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -54,7 +54,7 @@
|
||||
int
|
||||
mkstemp(char *name_template)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_putenv.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $
|
||||
* $Id: stdlib_putenv.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -50,7 +50,7 @@
|
||||
int
|
||||
putenv(const char *string)
|
||||
{
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: stdlib_setenv.c,v 1.8 2005-03-18 12:38:25 obarthel Exp $
|
||||
* $Id: stdlib_setenv.c,v 1.9 2005-04-24 08:46:37 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@ -101,7 +101,7 @@ setenv(const char *original_name, const char *original_value, int overwrite)
|
||||
struct LocalVariable * lv = NULL;
|
||||
struct LocalVar * found;
|
||||
int status;
|
||||
int result = -1;
|
||||
int result = ERROR;
|
||||
size_t i;
|
||||
|
||||
ENTER();
|
||||
@ -192,7 +192,7 @@ setenv(const char *original_name, const char *original_value, int overwrite)
|
||||
{
|
||||
SHOWMSG("variable already exists; leaving...");
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
@ -243,7 +243,7 @@ setenv(const char *original_name, const char *original_value, int overwrite)
|
||||
goto out;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
result = OK;
|
||||
|
||||
out:
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user