From 1d611fefbe388aa857c5e6a56f2ea9c4c551fd25 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Sun, 24 Apr 2005 08:46:37 +0000 Subject: [PATCH] - 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 --- library/dirent_closedir.c | 6 +++--- library/fcntl_close.c | 6 +++--- library/fcntl_creat.c | 4 ++-- library/fcntl_fcntl.c | 10 +++++----- library/fcntl_get_default_file.c | 4 ++-- library/fcntl_lseek.c | 6 +++--- library/fcntl_open.c | 6 +++--- library/fcntl_read.c | 6 +++--- library/fcntl_write.c | 6 +++--- library/ftw_ftw.c | 10 +++++----- library/ftw_nftw.c | 14 +++++++------- library/locale_init_exit.c | 6 +++--- library/mount_fstatfs.c | 6 +++--- library/mount_statfs.c | 8 ++++---- library/sas_profile.c | 4 ++-- library/signal_kill.c | 6 +++--- library/signal_raise.c | 6 +++--- library/signal_sigaddset.c | 6 +++--- library/signal_sigemptyset.c | 6 +++--- library/signal_sigmask.c | 4 ++-- library/signal_sigprocmask.c | 6 +++--- library/socket_accept.c | 4 ++-- library/socket_bind.c | 4 ++-- library/socket_connect.c | 4 ++-- library/socket_gethostname.c | 4 ++-- library/socket_getpeername.c | 4 ++-- library/socket_getsockname.c | 4 ++-- library/socket_getsockopt.c | 4 ++-- library/socket_hook_entry.c | 10 +++++----- library/socket_ioctl.c | 4 ++-- library/socket_listen.c | 4 ++-- library/socket_recv.c | 4 ++-- library/socket_recvfrom.c | 4 ++-- library/socket_recvmsg.c | 4 ++-- library/socket_select.c | 4 ++-- library/socket_send.c | 4 ++-- library/socket_sendmsg.c | 4 ++-- library/socket_sendto.c | 4 ++-- library/socket_setsockopt.c | 4 ++-- library/socket_shutdown.c | 4 ++-- library/socket_socket.c | 4 ++-- library/stat_chmod.c | 6 +++--- library/stat_fchmod.c | 6 +++--- library/stat_fstat.c | 6 +++--- library/stat_lstat.c | 8 ++++---- library/stat_mkdir.c | 6 +++--- library/stat_rmdir.c | 6 +++--- library/stat_stat.c | 9 +++++---- library/stdio_asprintf.c | 4 ++-- library/stdio_dropiobreadbuffer.c | 8 ++++---- library/stdio_fclose.c | 4 ++-- library/stdio_fdhookentry.c | 28 ++++++++++++++-------------- library/stdio_fflush.c | 4 ++-- library/stdio_fgetc.c | 6 +++--- library/stdio_fgetpos.c | 6 +++--- library/stdio_file_init.c | 6 +++--- library/stdio_filliobreadbuffer.c | 8 ++++---- library/stdio_findvacantfdentry.c | 4 ++-- library/stdio_findvacantiobentry.c | 4 ++-- library/stdio_flush_all_files.c | 6 +++--- library/stdio_flushiobwritebuffer.c | 8 ++++---- library/stdio_fprintf.c | 4 ++-- library/stdio_fputc.c | 4 ++-- library/stdio_fputs.c | 4 ++-- library/stdio_fseek.c | 8 ++++---- library/stdio_fsetpos.c | 4 ++-- library/stdio_ftell.c | 6 +++--- library/stdio_ftrylockfile.c | 6 +++--- library/stdio_getc.c | 4 ++-- library/stdio_getc_unlocked.c | 4 ++-- library/stdio_getchar_unlocked.c | 4 ++-- library/stdio_grow_file.c | 8 ++++---- library/stdio_growfdtable.c | 6 +++--- library/stdio_growiobtable.c | 6 +++--- library/stdio_headers.h | 4 ++-- library/stdio_iobhookentry.c | 6 +++--- library/stdio_lock.c | 6 +++--- library/stdio_openiob.c | 6 +++--- library/stdio_popen.c | 6 +++--- library/stdio_printf.c | 4 ++-- library/stdio_putc.c | 4 ++-- library/stdio_putc_unlocked.c | 4 ++-- library/stdio_putchar_unlocked.c | 4 ++-- library/stdio_puts.c | 4 ++-- library/stdio_record_locking.c | 4 ++-- library/stdio_remove.c | 6 +++--- library/stdio_rename.c | 6 +++--- library/stdio_scanf.c | 4 ++-- library/stdio_setvbuf.c | 4 ++-- library/stdio_snprintf.c | 4 ++-- library/stdio_sprintf.c | 4 ++-- library/stdio_sscanf_hook_entry.c | 4 ++-- library/stdio_vasprintf_hook_entry.c | 4 ++-- library/stdio_vprintf.c | 4 ++-- library/stdio_vsnprintf_hook_entry.c | 4 ++-- library/stdio_vsprintf_hook_entry.c | 4 ++-- library/stdlib_atexit.c | 6 +++--- library/stdlib_mkstemp.c | 4 ++-- library/stdlib_putenv.c | 4 ++-- library/stdlib_setenv.c | 8 ++++---- library/stdlib_system.c | 8 ++++---- library/uio_readv.c | 6 +++--- library/uio_writev.c | 8 ++++---- library/unistd_access.c | 6 +++--- library/unistd_chdir.c | 8 ++++---- library/unistd_chown.c | 6 +++--- library/unistd_dup2.c | 4 ++-- library/unistd_fchown.c | 6 +++--- library/unistd_fdatasync.c | 6 +++--- library/unistd_fileno.c | 4 ++-- library/unistd_fsync.c | 6 +++--- library/unistd_ftruncate.c | 16 ++++++++-------- library/unistd_isatty.c | 4 ++-- library/unistd_lchown.c | 4 ++-- library/unistd_link.c | 6 +++--- library/unistd_readlink.c | 4 ++-- library/unistd_setcurrentpath.c | 6 +++--- library/unistd_symlink.c | 6 +++--- library/unistd_sync_fd.c | 6 +++--- library/unistd_translatea2u.c | 6 +++--- library/unistd_translaterel.c | 6 +++--- library/unistd_translateu2a.c | 6 +++--- library/unistd_truncate.c | 4 ++-- library/unistd_unlink.c | 6 +++--- library/unistd_wildcard_expand.c | 6 +++--- library/usergroup_getgroups.c | 6 +++--- library/usergroup_initgroups.c | 4 ++-- library/usergroup_setgid.c | 4 ++-- library/usergroup_setgroups.c | 6 +++--- library/usergroup_setregid.c | 4 ++-- library/usergroup_setreuid.c | 4 ++-- library/usergroup_setuid.c | 4 ++-- library/utime_utime.c | 6 +++--- library/utsname_uname.c | 6 +++--- 134 files changed, 377 insertions(+), 376 deletions(-) diff --git a/library/dirent_closedir.c b/library/dirent_closedir.c index 27cd497..1287b21 100644 --- a/library/dirent_closedir.c +++ b/library/dirent_closedir.c @@ -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: diff --git a/library/fcntl_close.c b/library/fcntl_close.c index 4abe3df..f1dbbb5 100644 --- a/library/fcntl_close.c +++ b/library/fcntl_close.c @@ -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: diff --git a/library/fcntl_creat.c b/library/fcntl_creat.c index 1d18713..8295883 100644 --- a/library/fcntl_creat.c +++ b/library/fcntl_creat.c @@ -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(); diff --git a/library/fcntl_fcntl.c b/library/fcntl_fcntl.c index 4c8b6cc..7783a58 100644 --- a/library/fcntl_fcntl.c +++ b/library/fcntl_fcntl.c @@ -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; diff --git a/library/fcntl_get_default_file.c b/library/fcntl_get_default_file.c index 2dd5378..bb2d151 100644 --- a/library/fcntl_get_default_file.c +++ b/library/fcntl_get_default_file.c @@ -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 ); diff --git a/library/fcntl_lseek.c b/library/fcntl_lseek.c index d56b303..4288759 100644 --- a/library/fcntl_lseek.c +++ b/library/fcntl_lseek.c @@ -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; diff --git a/library/fcntl_open.c b/library/fcntl_open.c index c93f5e7..001623a 100644 --- a/library/fcntl_open.c +++ b/library/fcntl_open.c @@ -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: diff --git a/library/fcntl_read.c b/library/fcntl_read.c index f74935a..ecb1857 100644 --- a/library/fcntl_read.c +++ b/library/fcntl_read.c @@ -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; diff --git a/library/fcntl_write.c b/library/fcntl_write.c index 83d6e0e..3dc4f65 100644 --- a/library/fcntl_write.c +++ b/library/fcntl_write.c @@ -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; diff --git a/library/ftw_ftw.c b/library/ftw_ftw.c index ea22b50..08d1887 100644 --- a/library/ftw_ftw.c +++ b/library/ftw_ftw.c @@ -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; diff --git a/library/ftw_nftw.c b/library/ftw_nftw.c index f625498..f792ee4 100644 --- a/library/ftw_nftw.c +++ b/library/ftw_nftw.c @@ -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(); diff --git a/library/locale_init_exit.c b/library/locale_init_exit.c index 3a2a382..c39d033 100644 --- a/library/locale_init_exit.c +++ b/library/locale_init_exit.c @@ -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(); diff --git a/library/mount_fstatfs.c b/library/mount_fstatfs.c index 04ec23f..579d39f 100644 --- a/library/mount_fstatfs.c +++ b/library/mount_fstatfs.c @@ -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: diff --git a/library/mount_statfs.c b/library/mount_statfs.c index dde138c..522dd7f 100644 --- a/library/mount_statfs.c +++ b/library/mount_statfs.c @@ -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: diff --git a/library/sas_profile.c b/library/sas_profile.c index 4591cc3..0a944b7 100644 --- a/library/sas_profile.c +++ b/library/sas_profile.c @@ -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) diff --git a/library/signal_kill.c b/library/signal_kill.c index f9514b7..79be99a 100644 --- a/library/signal_kill.c +++ b/library/signal_kill.c @@ -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: diff --git a/library/signal_raise.c b/library/signal_raise.c index 94befc0..23716a6 100644 --- a/library/signal_raise.c +++ b/library/signal_raise.c @@ -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: diff --git a/library/signal_sigaddset.c b/library/signal_sigaddset.c index 33c2955..0a686d5 100644 --- a/library/signal_sigaddset.c +++ b/library/signal_sigaddset.c @@ -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: diff --git a/library/signal_sigemptyset.c b/library/signal_sigemptyset.c index 94b5ffb..b4fe6f8 100644 --- a/library/signal_sigemptyset.c +++ b/library/signal_sigemptyset.c @@ -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: diff --git a/library/signal_sigmask.c b/library/signal_sigmask.c index 8e2b65d..4b9df11 100644 --- a/library/signal_sigmask.c +++ b/library/signal_sigmask.c @@ -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<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; diff --git a/library/socket_ioctl.c b/library/socket_ioctl.c index 6aae6ed..1344856 100644 --- a/library/socket_ioctl.c +++ b/library/socket_ioctl.c @@ -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(); diff --git a/library/socket_listen.c b/library/socket_listen.c index 8ce5108..494dabe 100644 --- a/library/socket_listen.c +++ b/library/socket_listen.c @@ -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(); diff --git a/library/socket_recv.c b/library/socket_recv.c index 9c6ef7d..d239a17 100644 --- a/library/socket_recv.c +++ b/library/socket_recv.c @@ -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(); diff --git a/library/socket_recvfrom.c b/library/socket_recvfrom.c index 5fd94e9..e262539 100644 --- a/library/socket_recvfrom.c +++ b/library/socket_recvfrom.c @@ -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(); diff --git a/library/socket_recvmsg.c b/library/socket_recvmsg.c index a557824..8a628e8 100644 --- a/library/socket_recvmsg.c +++ b/library/socket_recvmsg.c @@ -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(); diff --git a/library/socket_select.c b/library/socket_select.c index 28b8faf..5d4b067 100644 --- a/library/socket_select.c +++ b/library/socket_select.c @@ -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; diff --git a/library/socket_send.c b/library/socket_send.c index 77436dd..0241b55 100644 --- a/library/socket_send.c +++ b/library/socket_send.c @@ -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(); diff --git a/library/socket_sendmsg.c b/library/socket_sendmsg.c index 5138cc8..634a090 100644 --- a/library/socket_sendmsg.c +++ b/library/socket_sendmsg.c @@ -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(); diff --git a/library/socket_sendto.c b/library/socket_sendto.c index b92119d..07dd303 100644 --- a/library/socket_sendto.c +++ b/library/socket_sendto.c @@ -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(); diff --git a/library/socket_setsockopt.c b/library/socket_setsockopt.c index c020166..efc238d 100644 --- a/library/socket_setsockopt.c +++ b/library/socket_setsockopt.c @@ -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(); diff --git a/library/socket_shutdown.c b/library/socket_shutdown.c index 57ccdad..a9ebf65 100644 --- a/library/socket_shutdown.c +++ b/library/socket_shutdown.c @@ -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(); diff --git a/library/socket_socket.c b/library/socket_socket.c index 1908824..858252b 100644 --- a/library/socket_socket.c +++ b/library/socket_socket.c @@ -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; diff --git a/library/stat_chmod.c b/library/stat_chmod.c index 61f1833..684dc29 100644 --- a/library/stat_chmod.c +++ b/library/stat_chmod.c @@ -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: diff --git a/library/stat_fchmod.c b/library/stat_fchmod.c index 37ea156..f97e21d 100644 --- a/library/stat_fchmod.c +++ b/library/stat_fchmod.c @@ -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: diff --git a/library/stat_fstat.c b/library/stat_fstat.c index 24c11f6..6eaccba 100644 --- a/library/stat_fstat.c +++ b/library/stat_fstat.c @@ -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: diff --git a/library/stat_lstat.c b/library/stat_lstat.c index 054e51b..b3eff5b 100644 --- a/library/stat_lstat.c +++ b/library/stat_lstat.c @@ -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: diff --git a/library/stat_mkdir.c b/library/stat_mkdir.c index 216acdf..66cf6f2 100644 --- a/library/stat_mkdir.c +++ b/library/stat_mkdir.c @@ -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: diff --git a/library/stat_rmdir.c b/library/stat_rmdir.c index 8ea1319..cb0ff56 100644 --- a/library/stat_rmdir.c +++ b/library/stat_rmdir.c @@ -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: diff --git a/library/stat_stat.c b/library/stat_stat.c index bb61549..fb83c1b 100644 --- a/library/stat_stat.c +++ b/library/stat_stat.c @@ -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: diff --git a/library/stdio_asprintf.c b/library/stdio_asprintf.c index d450d1c..bc58379 100644 --- a/library/stdio_asprintf.c +++ b/library/stdio_asprintf.c @@ -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(); diff --git a/library/stdio_dropiobreadbuffer.c b/library/stdio_dropiobreadbuffer.c index eb150f4..3ab3f37 100644 --- a/library/stdio_dropiobreadbuffer.c +++ b/library/stdio_dropiobreadbuffer.c @@ -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); diff --git a/library/stdio_fclose.c b/library/stdio_fclose.c index 04e4c88..37c9829 100644 --- a/library/stdio_fclose.c +++ b/library/stdio_fclose.c @@ -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(); diff --git a/library/stdio_fdhookentry.c b/library/stdio_fdhookentry.c index e5c3755..d7a41de 100644 --- a/library/stdio_fdhookentry.c +++ b/library/stdio_fdhookentry.c @@ -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; diff --git a/library/stdio_fflush.c b/library/stdio_fflush.c index 635af40..9829970 100644 --- a/library/stdio_fflush.c +++ b/library/stdio_fflush.c @@ -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: diff --git a/library/stdio_fgetc.c b/library/stdio_fgetc.c index 3e69e82..b2e1902 100644 --- a/library/stdio_fgetc.c +++ b/library/stdio_fgetc.c @@ -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: diff --git a/library/stdio_fgetpos.c b/library/stdio_fgetpos.c index a7f73d0..5f86734 100644 --- a/library/stdio_fgetpos.c +++ b/library/stdio_fgetpos.c @@ -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: diff --git a/library/stdio_file_init.c b/library/stdio_file_init.c index 7a76c2f..482e09a 100644 --- a/library/stdio_file_init.c +++ b/library/stdio_file_init.c @@ -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: diff --git a/library/stdio_filliobreadbuffer.c b/library/stdio_filliobreadbuffer.c index f37360e..d7cc7bf 100644 --- a/library/stdio_filliobreadbuffer.c +++ b/library/stdio_filliobreadbuffer.c @@ -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: diff --git a/library/stdio_findvacantfdentry.c b/library/stdio_findvacantfdentry.c index 12d2bc6..c0c18a9 100644 --- a/library/stdio_findvacantfdentry.c +++ b/library/stdio_findvacantfdentry.c @@ -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 ); diff --git a/library/stdio_findvacantiobentry.c b/library/stdio_findvacantiobentry.c index cb5132d..af8601e 100644 --- a/library/stdio_findvacantiobentry.c +++ b/library/stdio_findvacantiobentry.c @@ -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 ); diff --git a/library/stdio_flush_all_files.c b/library/stdio_flush_all_files.c index 35b0ca2..b26a9b7 100644 --- a/library/stdio_flush_all_files.c +++ b/library/stdio_flush_all_files.c @@ -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: diff --git a/library/stdio_flushiobwritebuffer.c b/library/stdio_flushiobwritebuffer.c index 6f9ad38..5c69cbe 100644 --- a/library/stdio_flushiobwritebuffer.c +++ b/library/stdio_flushiobwritebuffer.c @@ -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); diff --git a/library/stdio_fprintf.c b/library/stdio_fprintf.c index 6410472..05b1688 100644 --- a/library/stdio_fprintf.c +++ b/library/stdio_fprintf.c @@ -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(); diff --git a/library/stdio_fputc.c b/library/stdio_fputc.c index 5e6ceb7..eafd1e4 100644 --- a/library/stdio_fputc.c +++ b/library/stdio_fputc.c @@ -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: diff --git a/library/stdio_fputs.c b/library/stdio_fputs.c index d77ad0c..7e7f3c4 100644 --- a/library/stdio_fputs.c +++ b/library/stdio_fputs.c @@ -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: diff --git a/library/stdio_fseek.c b/library/stdio_fseek.c index 6279025..c5d529f 100644 --- a/library/stdio_fseek.c +++ b/library/stdio_fseek.c @@ -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: diff --git a/library/stdio_fsetpos.c b/library/stdio_fsetpos.c index 6d8899d..b3af081 100644 --- a/library/stdio_fsetpos.c +++ b/library/stdio_fsetpos.c @@ -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: diff --git a/library/stdio_ftell.c b/library/stdio_ftell.c index 4b175e4..c789bb2 100644 --- a/library/stdio_ftell.c +++ b/library/stdio_ftell.c @@ -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); diff --git a/library/stdio_ftrylockfile.c b/library/stdio_ftrylockfile.c index 75b2e91..8c46e9a 100644 --- a/library/stdio_ftrylockfile.c +++ b/library/stdio_ftrylockfile.c @@ -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: diff --git a/library/stdio_getc.c b/library/stdio_getc.c index 11bddb8..d17a433 100644 --- a/library/stdio_getc.c +++ b/library/stdio_getc.c @@ -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 ); diff --git a/library/stdio_getc_unlocked.c b/library/stdio_getc_unlocked.c index 4cfae8b..b4af8bb 100644 --- a/library/stdio_getc_unlocked.c +++ b/library/stdio_getc_unlocked.c @@ -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 ); diff --git a/library/stdio_getchar_unlocked.c b/library/stdio_getchar_unlocked.c index 41d7114..786402c 100644 --- a/library/stdio_getchar_unlocked.c +++ b/library/stdio_getchar_unlocked.c @@ -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 ); diff --git a/library/stdio_grow_file.c b/library/stdio_grow_file.c index 0c231d7..3a98ffb 100644 --- a/library/stdio_grow_file.c +++ b/library/stdio_grow_file.c @@ -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: diff --git a/library/stdio_growfdtable.c b/library/stdio_growfdtable.c index b65d1e2..31208d0 100644 --- a/library/stdio_growfdtable.c +++ b/library/stdio_growfdtable.c @@ -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: diff --git a/library/stdio_growiobtable.c b/library/stdio_growiobtable.c index 121fa55..0aab01d 100644 --- a/library/stdio_growiobtable.c +++ b/library/stdio_growiobtable.c @@ -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: diff --git a/library/stdio_headers.h b/library/stdio_headers.h index 32c33fe..c857497 100644 --- a/library/stdio_headers.h +++ b/library/stdio_headers.h @@ -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 */ diff --git a/library/stdio_iobhookentry.c b/library/stdio_iobhookentry.c index f7238ea..f914723 100644 --- a/library/stdio_iobhookentry.c +++ b/library/stdio_iobhookentry.c @@ -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; } diff --git a/library/stdio_lock.c b/library/stdio_lock.c index 9481d09..1829ffb 100644 --- a/library/stdio_lock.c +++ b/library/stdio_lock.c @@ -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: diff --git a/library/stdio_openiob.c b/library/stdio_openiob.c index f0622a2..6c38201 100644 --- a/library/stdio_openiob.c +++ b/library/stdio_openiob.c @@ -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: diff --git a/library/stdio_popen.c b/library/stdio_popen.c index 34535fa..61f47a6 100644 --- a/library/stdio_popen.c +++ b/library/stdio_popen.c @@ -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: diff --git a/library/stdio_printf.c b/library/stdio_printf.c index 4eac361..c532fdb 100644 --- a/library/stdio_printf.c +++ b/library/stdio_printf.c @@ -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(); diff --git a/library/stdio_putc.c b/library/stdio_putc.c index 668b64d..f2a1a1e 100644 --- a/library/stdio_putc.c +++ b/library/stdio_putc.c @@ -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 ); diff --git a/library/stdio_putc_unlocked.c b/library/stdio_putc_unlocked.c index b53bf02..bbf23aa 100644 --- a/library/stdio_putc_unlocked.c +++ b/library/stdio_putc_unlocked.c @@ -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 ); diff --git a/library/stdio_putchar_unlocked.c b/library/stdio_putchar_unlocked.c index f6660c3..8d90b02 100644 --- a/library/stdio_putchar_unlocked.c +++ b/library/stdio_putchar_unlocked.c @@ -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 ); diff --git a/library/stdio_puts.c b/library/stdio_puts.c index 48a69d7..b8bf78e 100644 --- a/library/stdio_puts.c +++ b/library/stdio_puts.c @@ -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: diff --git a/library/stdio_record_locking.c b/library/stdio_record_locking.c index 1d3248f..3ea093f 100644 --- a/library/stdio_record_locking.c +++ b/library/stdio_record_locking.c @@ -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: diff --git a/library/stdio_remove.c b/library/stdio_remove.c index b459e2e..de7ad8d 100644 --- a/library/stdio_remove.c +++ b/library/stdio_remove.c @@ -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 */ diff --git a/library/stdio_rename.c b/library/stdio_rename.c index 46707a4..348f393 100644 --- a/library/stdio_rename.c +++ b/library/stdio_rename.c @@ -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: diff --git a/library/stdio_scanf.c b/library/stdio_scanf.c index 18d9ade..ea0ed49 100644 --- a/library/stdio_scanf.c +++ b/library/stdio_scanf.c @@ -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(); diff --git a/library/stdio_setvbuf.c b/library/stdio_setvbuf.c index d4900bd..fd04f62 100644 --- a/library/stdio_setvbuf.c +++ b/library/stdio_setvbuf.c @@ -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: diff --git a/library/stdio_snprintf.c b/library/stdio_snprintf.c index 9b427ec..1d4bf73 100644 --- a/library/stdio_snprintf.c +++ b/library/stdio_snprintf.c @@ -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(); diff --git a/library/stdio_sprintf.c b/library/stdio_sprintf.c index 147a6dc..a937900 100644 --- a/library/stdio_sprintf.c +++ b/library/stdio_sprintf.c @@ -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(); diff --git a/library/stdio_sscanf_hook_entry.c b/library/stdio_sscanf_hook_entry.c index 6a3d12d..e490a4a 100644 --- a/library/stdio_sscanf_hook_entry.c +++ b/library/stdio_sscanf_hook_entry.c @@ -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 ); diff --git a/library/stdio_vasprintf_hook_entry.c b/library/stdio_vasprintf_hook_entry.c index e868b51..a0c2bea 100644 --- a/library/stdio_vasprintf_hook_entry.c +++ b/library/stdio_vasprintf_hook_entry.c @@ -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; diff --git a/library/stdio_vprintf.c b/library/stdio_vprintf.c index 6323e4c..49fd7f0 100644 --- a/library/stdio_vprintf.c +++ b/library/stdio_vprintf.c @@ -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(); diff --git a/library/stdio_vsnprintf_hook_entry.c b/library/stdio_vsnprintf_hook_entry.c index 57e390d..e07a4a6 100644 --- a/library/stdio_vsnprintf_hook_entry.c +++ b/library/stdio_vsnprintf_hook_entry.c @@ -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 ); diff --git a/library/stdio_vsprintf_hook_entry.c b/library/stdio_vsprintf_hook_entry.c index 5a6bbbc..0c47d48 100644 --- a/library/stdio_vsprintf_hook_entry.c +++ b/library/stdio_vsprintf_hook_entry.c @@ -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 ); diff --git a/library/stdlib_atexit.c b/library/stdlib_atexit.c index f1f08ef..dc2c4c7 100644 --- a/library/stdlib_atexit.c +++ b/library/stdlib_atexit.c @@ -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: diff --git a/library/stdlib_mkstemp.c b/library/stdlib_mkstemp.c index b535bce..1d46252 100644 --- a/library/stdlib_mkstemp.c +++ b/library/stdlib_mkstemp.c @@ -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(); diff --git a/library/stdlib_putenv.c b/library/stdlib_putenv.c index 861526d..4bc6ea7 100644 --- a/library/stdlib_putenv.c +++ b/library/stdlib_putenv.c @@ -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(); diff --git a/library/stdlib_setenv.c b/library/stdlib_setenv.c index a38076e..e65ae0d 100644 --- a/library/stdlib_setenv.c +++ b/library/stdlib_setenv.c @@ -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: diff --git a/library/stdlib_system.c b/library/stdlib_system.c index 344a98b..51a3881 100644 --- a/library/stdlib_system.c +++ b/library/stdlib_system.c @@ -1,5 +1,5 @@ /* - * $Id: stdlib_system.c,v 1.7 2005-03-25 08:50:59 obarthel Exp $ + * $Id: stdlib_system.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -122,7 +122,7 @@ system(const char * command) { __set_errno(ENAMETOOLONG); - result = -1; + result = ERROR; goto out; } @@ -140,7 +140,7 @@ system(const char * command) if(__translate_unix_to_amiga_path_name((const char **)&command_name,&command_nti) != 0) { - result = -1; + result = ERROR; goto out; } @@ -150,7 +150,7 @@ system(const char * command) { __set_errno(ENOMEM); - result = -1; + result = ERROR; goto out; } diff --git a/library/uio_readv.c b/library/uio_readv.c index 66bf960..7c159a2 100644 --- a/library/uio_readv.c +++ b/library/uio_readv.c @@ -1,5 +1,5 @@ /* - * $Id: uio_readv.c,v 1.2 2005-04-03 10:53:24 obarthel Exp $ + * $Id: uio_readv.c,v 1.3 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ ssize_t readv(int file_descriptor,const struct iovec *iov,int vec_count) { - ssize_t result = -1; + ssize_t result = EOF; struct file_action_message msg; ssize_t total_num_bytes_read; ssize_t part_num_bytes_read; @@ -115,7 +115,7 @@ readv(int file_descriptor,const struct iovec *iov,int vec_count) msg.fam_Size = iov[i].iov_len - part_num_bytes_read; num_bytes_read = (*fd->fd_Action)(fd,&msg); - if(num_bytes_read < 0) + if(num_bytes_read == EOF) { __set_errno(msg.fam_Error); goto out; diff --git a/library/uio_writev.c b/library/uio_writev.c index 35376cd..55b0138 100644 --- a/library/uio_writev.c +++ b/library/uio_writev.c @@ -1,5 +1,5 @@ /* - * $Id: uio_writev.c,v 1.2 2005-04-03 10:53:24 obarthel Exp $ + * $Id: uio_writev.c,v 1.3 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ ssize_t writev(int file_descriptor,const struct iovec *iov,int vec_count) { - ssize_t result = -1; + ssize_t result = EOF; struct file_action_message msg; ssize_t total_num_bytes_written; char * buffer = NULL; @@ -113,7 +113,7 @@ writev(int file_descriptor,const struct iovec *iov,int vec_count) msg.fam_Data = buffer; msg.fam_Size = total_num_bytes_written; - if((*fd->fd_Action)(fd,&msg) < 0) + if((*fd->fd_Action)(fd,&msg) == EOF) { __set_errno(msg.fam_Error); goto out; @@ -132,7 +132,7 @@ writev(int file_descriptor,const struct iovec *iov,int vec_count) msg.fam_Data = (char *)iov[i].iov_base; msg.fam_Size = iov[i].iov_len; - if((*fd->fd_Action)(fd,&msg) < 0) + if((*fd->fd_Action)(fd,&msg) == EOF) { __set_errno(msg.fam_Error); goto out; diff --git a/library/unistd_access.c b/library/unistd_access.c index d80d9d9..82e9807 100644 --- a/library/unistd_access.c +++ b/library/unistd_access.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_access.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ + * $Id: unistd_access.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -53,7 +53,7 @@ access(const char * path_name, int mode) #if defined(UNIX_PATH_SEMANTICS) struct name_translation_info path_name_nti; #endif /* UNIX_PATH_SEMANTICS */ - int result = -1; + int result = ERROR; BPTR lock = ZERO; ENTER(); @@ -218,7 +218,7 @@ access(const char * path_name, int mode) } } - result = 0; + result = OK; out: diff --git a/library/unistd_chdir.c b/library/unistd_chdir.c index 87ebf84..18ad514 100644 --- a/library/unistd_chdir.c +++ b/library/unistd_chdir.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_chdir.c,v 1.6 2005-03-27 10:02:50 obarthel Exp $ + * $Id: unistd_chdir.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -57,7 +57,7 @@ chdir(const char * path_name) D_S(struct FileInfoBlock,fib); BPTR dir_lock = ZERO; LONG status; - int result = -1; + int result = ERROR; ENTER(); @@ -100,7 +100,7 @@ chdir(const char * path_name) /* ZZZ this must not fail */ __set_current_path(path_name); - result = 0; + result = OK; goto out; } @@ -172,7 +172,7 @@ chdir(const char * path_name) } #endif /* UNIX_PATH_SEMANTICS */ - result = 0; + result = OK; out: diff --git a/library/unistd_chown.c b/library/unistd_chown.c index 692ae41..6e6dba4 100644 --- a/library/unistd_chown.c +++ b/library/unistd_chown.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_chown.c,v 1.6 2005-02-28 10:07:32 obarthel Exp $ + * $Id: unistd_chown.c,v 1.7 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -55,7 +55,7 @@ chown(const char * path_name, uid_t owner, gid_t group) #endif /* UNIX_PATH_SEMANTICS */ struct DevProc * dvp = NULL; LONG status; - int result = -1; + int result = ERROR; ENTER(); @@ -158,7 +158,7 @@ chown(const char * path_name, uid_t owner, gid_t group) goto out; } - result = 0; + result = OK; out: diff --git a/library/unistd_dup2.c b/library/unistd_dup2.c index ca24b44..eeefcb4 100644 --- a/library/unistd_dup2.c +++ b/library/unistd_dup2.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_dup2.c,v 1.8 2005-03-04 09:07:09 obarthel Exp $ + * $Id: unistd_dup2.c,v 1.9 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -45,7 +45,7 @@ int dup2(int file_descriptor1, int file_descriptor2) { struct fd * fd1; - int result = -1; + int result = ERROR; ENTER(); diff --git a/library/unistd_fchown.c b/library/unistd_fchown.c index 051ce97..0bb0086 100644 --- a/library/unistd_fchown.c +++ b/library/unistd_fchown.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_fchown.c,v 1.9 2005-04-01 18:46:37 obarthel Exp $ + * $Id: unistd_fchown.c,v 1.10 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -48,7 +48,7 @@ fchown(int file_descriptor, uid_t owner, gid_t group) 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; @@ -167,7 +167,7 @@ fchown(int file_descriptor, uid_t owner, gid_t group) goto out; } - result = 0; + result = OK; out: diff --git a/library/unistd_fdatasync.c b/library/unistd_fdatasync.c index 55eaa48..80fee5e 100644 --- a/library/unistd_fdatasync.c +++ b/library/unistd_fdatasync.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_fdatasync.c,v 1.5 2005-03-07 11:58:50 obarthel Exp $ + * $Id: unistd_fdatasync.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -51,7 +51,7 @@ int fdatasync(int file_descriptor) { struct fd * fd; - int result = -1; + int result = ERROR; ENTER(); @@ -74,7 +74,7 @@ fdatasync(int file_descriptor) if(__sync_fd(fd,0) < 0) /* flush just the data */ goto out; - result = 0; + result = OK; out: diff --git a/library/unistd_fileno.c b/library/unistd_fileno.c index 8cec5ff..0438df8 100644 --- a/library/unistd_fileno.c +++ b/library/unistd_fileno.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_fileno.c,v 1.5 2005-02-27 18:09:11 obarthel Exp $ + * $Id: unistd_fileno.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -51,7 +51,7 @@ int fileno(FILE * file) { struct iob * iob = (struct iob *)file; - int result = -1; + int result = ERROR; ENTER(); diff --git a/library/unistd_fsync.c b/library/unistd_fsync.c index b0ac587..680dacd 100644 --- a/library/unistd_fsync.c +++ b/library/unistd_fsync.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_fsync.c,v 1.5 2005-03-07 11:58:50 obarthel Exp $ + * $Id: unistd_fsync.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ int fsync(int file_descriptor) { struct fd * fd; - int result = -1; + int result = ERROR; ENTER(); @@ -73,7 +73,7 @@ fsync(int file_descriptor) if(__sync_fd(fd,1) < 0) /* flush everything */ goto out; - result = 0; + result = OK; out: diff --git a/library/unistd_ftruncate.c b/library/unistd_ftruncate.c index 6ab0962..6d5f073 100644 --- a/library/unistd_ftruncate.c +++ b/library/unistd_ftruncate.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_ftruncate.c,v 1.10 2005-04-01 18:46:37 obarthel Exp $ + * $Id: unistd_ftruncate.c,v 1.11 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -45,7 +45,7 @@ int ftruncate(int file_descriptor, off_t length) { D_S(struct FileInfoBlock,fib); - int result = -1; + int result = ERROR; struct fd * fd = NULL; BOOL restore_initial_position = FALSE; off_t current_file_size; @@ -122,12 +122,12 @@ ftruncate(int file_descriptor, off_t length) if(initial_position < 0) { initial_position = Seek(fd->fd_DefaultFile,0,OFFSET_CURRENT); - if(initial_position < 0) + if(initial_position == SEEK_ERROR) goto out; } /* Careful: seek to a position where the file can be safely truncated. */ - if(Seek(fd->fd_DefaultFile,length,OFFSET_BEGINNING) < 0) + if(Seek(fd->fd_DefaultFile,length,OFFSET_BEGINNING) == SEEK_ERROR) { D(("could not move to file offset %ld",length)); @@ -135,7 +135,7 @@ ftruncate(int file_descriptor, off_t length) goto out; } - if(SetFileSize(fd->fd_DefaultFile,length,OFFSET_BEGINNING) < 0) + if(SetFileSize(fd->fd_DefaultFile,length,OFFSET_BEGINNING) == SEEK_ERROR) { D(("could not reduce file to size %ld",length)); @@ -163,12 +163,12 @@ ftruncate(int file_descriptor, off_t length) if(initial_position < 0) { initial_position = Seek(fd->fd_DefaultFile,0,OFFSET_CURRENT); - if(initial_position < 0) + if(initial_position == SEEK_ERROR) goto out; } /* Move to what should be the end of the file. */ - if(Seek(fd->fd_DefaultFile,current_file_size,OFFSET_BEGINNING) < 0) + if(Seek(fd->fd_DefaultFile,current_file_size,OFFSET_BEGINNING) == SEEK_ERROR) { D(("could not move to file offset %ld",current_file_size)); @@ -189,7 +189,7 @@ ftruncate(int file_descriptor, off_t length) restore_initial_position = TRUE; } - result = 0; + result = OK; out: diff --git a/library/unistd_isatty.c b/library/unistd_isatty.c index b75885b..8a49a19 100644 --- a/library/unistd_isatty.c +++ b/library/unistd_isatty.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_isatty.c,v 1.5 2005-02-03 16:56:17 obarthel Exp $ + * $Id: unistd_isatty.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -44,7 +44,7 @@ int isatty(int file_descriptor) { - int result = -1; + int result = ERROR; struct fd * fd; ENTER(); diff --git a/library/unistd_lchown.c b/library/unistd_lchown.c index 4b79a98..5270329 100644 --- a/library/unistd_lchown.c +++ b/library/unistd_lchown.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_lchown.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ + * $Id: unistd_lchown.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ int lchown(const char * path_name, uid_t owner, gid_t group) { - int result = -1; + int result = ERROR; ENTER(); diff --git a/library/unistd_link.c b/library/unistd_link.c index 1f4cad6..bb2aa1a 100644 --- a/library/unistd_link.c +++ b/library/unistd_link.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_link.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ + * $Id: unistd_link.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -55,7 +55,7 @@ link(const char * existing_path,const char * new_path) struct name_translation_info new_path_name_nti; #endif /* UNIX_PATH_SEMANTICS */ BPTR existing_path_lock = ZERO; - int result = -1; + int result = ERROR; LONG status; ENTER(); @@ -127,7 +127,7 @@ link(const char * existing_path,const char * new_path) goto out; } - result = 0; + result = OK; out: diff --git a/library/unistd_readlink.c b/library/unistd_readlink.c index f177b62..efa1d26 100644 --- a/library/unistd_readlink.c +++ b/library/unistd_readlink.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_readlink.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ + * $Id: unistd_readlink.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -56,7 +56,7 @@ readlink(const char * path_name, char * buffer, int buffer_size) #endif /* UNIX_PATH_SEMANTICS */ struct DevProc * dvp = NULL; BPTR lock = ZERO; - int result = -1; + int result = ERROR; ENTER(); diff --git a/library/unistd_setcurrentpath.c b/library/unistd_setcurrentpath.c index a46ec45..a6e523f 100644 --- a/library/unistd_setcurrentpath.c +++ b/library/unistd_setcurrentpath.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_setcurrentpath.c,v 1.3 2005-02-03 16:56:17 obarthel Exp $ + * $Id: unistd_setcurrentpath.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -40,7 +40,7 @@ int __set_current_path(const char * path_name) { - int result = -1; + int result = ERROR; SHOWSTRING(path_name); @@ -62,7 +62,7 @@ __set_current_path(const char * path_name) else strcpy(__current_path_name,""); - result = 0; + result = OK; out: diff --git a/library/unistd_symlink.c b/library/unistd_symlink.c index 0fb5400..e5de909 100644 --- a/library/unistd_symlink.c +++ b/library/unistd_symlink.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_symlink.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ + * $Id: unistd_symlink.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -53,7 +53,7 @@ int symlink(const char * actual_path, const char * symbolic_path) { - int result = -1; + int result = ERROR; LONG status; ENTER(); @@ -92,7 +92,7 @@ symlink(const char * actual_path, const char * symbolic_path) goto out; } - result = 0; + result = OK; out: diff --git a/library/unistd_sync_fd.c b/library/unistd_sync_fd.c index 64df52b..1d67eb7 100644 --- a/library/unistd_sync_fd.c +++ b/library/unistd_sync_fd.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_sync_fd.c,v 1.5 2005-04-01 18:46:37 obarthel Exp $ + * $Id: unistd_sync_fd.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ int __sync_fd(struct fd * fd,int mode) { - int result = -1; + int result = ERROR; assert( fd != NULL ); @@ -81,7 +81,7 @@ __sync_fd(struct fd * fd,int mode) DoPkt(fh->fh_Type,ACTION_FLUSH, 0,0,0,0,0); } - result = 0; + result = OK; out: diff --git a/library/unistd_translatea2u.c b/library/unistd_translatea2u.c index bc97d88..9b9a935 100644 --- a/library/unistd_translatea2u.c +++ b/library/unistd_translatea2u.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_translatea2u.c,v 1.4 2005-02-28 13:32:11 obarthel Exp $ + * $Id: unistd_translatea2u.c,v 1.5 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -44,7 +44,7 @@ __translate_amiga_to_unix_path_name(char const ** name_ptr,struct name_translati char local_replacement[sizeof(nti->substitute)]; BOOL have_double_slash; int len,replace_len; - int result = -1; + int result = ERROR; int i; char * replace; char * name; @@ -275,7 +275,7 @@ __translate_amiga_to_unix_path_name(char const ** name_ptr,struct name_translati D(("translated '%s' to '%s'",nti->original_name,name)); - result = 0; + result = OK; out: diff --git a/library/unistd_translaterel.c b/library/unistd_translaterel.c index 99d6fbc..35e84aa 100644 --- a/library/unistd_translaterel.c +++ b/library/unistd_translaterel.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_translaterel.c,v 1.3 2005-02-03 16:56:17 obarthel Exp $ + * $Id: unistd_translaterel.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -40,7 +40,7 @@ int __translate_relative_path_name(char const ** name_ptr,char *replacement_buffer,size_t replacement_buffer_size) { - int result = -1; + int result = ERROR; char * name; assert( name_ptr != NULL && (*name_ptr) != NULL && replacement_buffer != NULL ); @@ -95,7 +95,7 @@ __translate_relative_path_name(char const ** name_ptr,char *replacement_buffer,s (*name_ptr) = replacement_buffer; } - result = 0; + result = OK; out: diff --git a/library/unistd_translateu2a.c b/library/unistd_translateu2a.c index abbdf51..80d85eb 100644 --- a/library/unistd_translateu2a.c +++ b/library/unistd_translateu2a.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_translateu2a.c,v 1.7 2005-02-28 13:32:11 obarthel Exp $ + * $Id: unistd_translateu2a.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -75,7 +75,7 @@ int __translate_unix_to_amiga_path_name(char const ** name_ptr,struct name_translation_info * nti) { - int result = -1; + int result = ERROR; char * name; /*PUSHDEBUGLEVEL(2);*/ @@ -544,7 +544,7 @@ __translate_unix_to_amiga_path_name(char const ** name_ptr,struct name_translati D(("translated '%s' to '%s'",nti->original_name,name)); - result = 0; + result = OK; out: diff --git a/library/unistd_truncate.c b/library/unistd_truncate.c index ad9b464..d170792 100644 --- a/library/unistd_truncate.c +++ b/library/unistd_truncate.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_truncate.c,v 1.5 2005-02-28 10:07:32 obarthel Exp $ + * $Id: unistd_truncate.c,v 1.6 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ int truncate(const char * path_name, off_t length) { - int result = -1; + int result = ERROR; int fd; ENTER(); diff --git a/library/unistd_unlink.c b/library/unistd_unlink.c index 5a8d453..1d52168 100644 --- a/library/unistd_unlink.c +++ b/library/unistd_unlink.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_unlink.c,v 1.7 2005-03-27 10:02:50 obarthel Exp $ + * $Id: unistd_unlink.c,v 1.8 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -62,7 +62,7 @@ unlink(const char * path_name) struct name_translation_info path_name_nti; #endif /* UNIX_PATH_SEMANTICS */ BPTR current_dir = ZERO; - int result = -1; + int result = ERROR; LONG status; ENTER(); @@ -179,7 +179,7 @@ unlink(const char * path_name) #endif /* UNIX_PATH_SEMANTICS */ } - result = 0; + result = OK; out: diff --git a/library/unistd_wildcard_expand.c b/library/unistd_wildcard_expand.c index b86681a..1b61ec6 100644 --- a/library/unistd_wildcard_expand.c +++ b/library/unistd_wildcard_expand.c @@ -1,5 +1,5 @@ /* - * $Id: unistd_wildcard_expand.c,v 1.11 2005-03-18 12:38:25 obarthel Exp $ + * $Id: unistd_wildcard_expand.c,v 1.12 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -70,7 +70,7 @@ int __wildcard_quote_parameter(unsigned int parameter) { size_t num_bytes; - int result = -1; + int result = ERROR; /* Can we mark this parameter as quoted or do we need more room in the buffer? */ @@ -97,7 +97,7 @@ __wildcard_quote_parameter(unsigned int parameter) quote_vector[parameter / 8] |= 1 << (7 - (parameter & 7)); - result = 0; + result = OK; out: diff --git a/library/usergroup_getgroups.c b/library/usergroup_getgroups.c index 730d152..0ce11c1 100644 --- a/library/usergroup_getgroups.c +++ b/library/usergroup_getgroups.c @@ -1,5 +1,5 @@ /* - * $Id: usergroup_getgroups.c,v 1.3 2005-02-03 16:56:17 obarthel Exp $ + * $Id: usergroup_getgroups.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ int getgroups(int ngroups, gid_t *groups) { - int result = -1; + int result = ERROR; ENTER(); @@ -80,7 +80,7 @@ getgroups(int ngroups, gid_t *groups) } else { - result = 0; + result = OK; } out: diff --git a/library/usergroup_initgroups.c b/library/usergroup_initgroups.c index 229e39a..fe72eb7 100644 --- a/library/usergroup_initgroups.c +++ b/library/usergroup_initgroups.c @@ -1,5 +1,5 @@ /* - * $Id: usergroup_initgroups.c,v 1.3 2005-02-03 16:56:17 obarthel Exp $ + * $Id: usergroup_initgroups.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ int initgroups(const char *name, gid_t basegroup) { - int result = -1; + int result = ERROR; ENTER(); diff --git a/library/usergroup_setgid.c b/library/usergroup_setgid.c index 7f5af42..70e8c6b 100644 --- a/library/usergroup_setgid.c +++ b/library/usergroup_setgid.c @@ -1,5 +1,5 @@ /* - * $Id: usergroup_setgid.c,v 1.2 2005-01-02 09:07:19 obarthel Exp $ + * $Id: usergroup_setgid.c,v 1.3 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -56,7 +56,7 @@ setgid(gid_t id) { __root_gid = id; - result = 0; + result = OK; } else { diff --git a/library/usergroup_setgroups.c b/library/usergroup_setgroups.c index 8ce596c..8323647 100644 --- a/library/usergroup_setgroups.c +++ b/library/usergroup_setgroups.c @@ -1,5 +1,5 @@ /* - * $Id: usergroup_setgroups.c,v 1.3 2005-02-03 16:56:17 obarthel Exp $ + * $Id: usergroup_setgroups.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -50,7 +50,7 @@ int setgroups(int ngroups,const gid_t *groups) { - int result = -1; + int result = ERROR; ENTER(); @@ -80,7 +80,7 @@ setgroups(int ngroups,const gid_t *groups) } else { - result = 0; + result = OK; } out: diff --git a/library/usergroup_setregid.c b/library/usergroup_setregid.c index d868163..833afdf 100644 --- a/library/usergroup_setregid.c +++ b/library/usergroup_setregid.c @@ -1,5 +1,5 @@ /* - * $Id: usergroup_setregid.c,v 1.2 2005-01-02 09:07:19 obarthel Exp $ + * $Id: usergroup_setregid.c,v 1.3 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -61,7 +61,7 @@ setregid(gid_t real, gid_t eff) if(eff != (gid_t)-1) __root_egid = eff; - result = 0; + result = OK; } else { diff --git a/library/usergroup_setreuid.c b/library/usergroup_setreuid.c index 76a6ac9..377a38b 100644 --- a/library/usergroup_setreuid.c +++ b/library/usergroup_setreuid.c @@ -1,5 +1,5 @@ /* - * $Id: usergroup_setreuid.c,v 1.2 2005-01-02 09:07:19 obarthel Exp $ + * $Id: usergroup_setreuid.c,v 1.3 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -61,7 +61,7 @@ setreuid(uid_t real, uid_t eff) if(eff != (uid_t)-1) __root_euid = eff; - result = 0; + result = OK; } else { diff --git a/library/usergroup_setuid.c b/library/usergroup_setuid.c index e305e76..3648ed4 100644 --- a/library/usergroup_setuid.c +++ b/library/usergroup_setuid.c @@ -1,5 +1,5 @@ /* - * $Id: usergroup_setuid.c,v 1.2 2005-01-02 09:07:19 obarthel Exp $ + * $Id: usergroup_setuid.c,v 1.3 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -56,7 +56,7 @@ setuid(uid_t id) { __root_uid = id; - result = 0; + result = OK; } else { diff --git a/library/utime_utime.c b/library/utime_utime.c index fbcb8b6..b2fb7ab 100644 --- a/library/utime_utime.c +++ b/library/utime_utime.c @@ -1,5 +1,5 @@ /* - * $Id: utime_utime.c,v 1.9 2005-03-19 10:15:56 obarthel Exp $ + * $Id: utime_utime.c,v 1.10 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -54,7 +54,7 @@ utime(const char * path_name,const struct utimbuf * times) struct name_translation_info path_name_nti; #endif /* UNIX_PATH_SEMANTICS */ struct DateStamp ds; - int result = -1; + int result = ERROR; LONG status; assert( path_name != NULL ); @@ -115,7 +115,7 @@ utime(const char * path_name,const struct utimbuf * times) goto out; } - result = 0; + result = OK; out: diff --git a/library/utsname_uname.c b/library/utsname_uname.c index b3a11ce..b6ececd 100644 --- a/library/utsname_uname.c +++ b/library/utsname_uname.c @@ -1,5 +1,5 @@ /* - * $Id: utsname_uname.c,v 1.3 2005-03-18 12:38:25 obarthel Exp $ + * $Id: utsname_uname.c,v 1.4 2005-04-24 08:46:37 obarthel Exp $ * * :ts=4 * @@ -69,7 +69,7 @@ uname(struct utsname *info) struct Library * VersionBase; int Version,Revision; char * version_string; - int result = -1; + int result = ERROR; ENTER(); @@ -158,7 +158,7 @@ uname(struct utsname *info) SHOWSTRING(info->version); SHOWSTRING(info->machine); - result = 0; + result = OK; out: