diff options
author | Jonathan Pryor <jpryor@novell.com> | 2006-11-02 06:45:34 +0300 |
---|---|---|
committer | Jonathan Pryor <jpryor@novell.com> | 2006-11-02 06:45:34 +0300 |
commit | c0dfc5f803aa7501584e64066d95bb362534c701 (patch) | |
tree | a8f976c4771a4f2ba2a3efcd143049a13b0e58f3 /support | |
parent | aa0f7790e5dc11862a86f98a8e83becdc161faca (diff) |
* stdio.c: Some BSDs define clearerr(3) as a macro, so we need to cast
`stream' to a `FILE*' to avoid derefing a `void*'.
* sys-statvfs.c: Build fix to support OS X 10.3.9 & systems w/o statvfs(2).
svn path=/trunk/mono/; revision=67254
Diffstat (limited to 'support')
-rw-r--r-- | support/ChangeLog | 6 | ||||
-rw-r--r-- | support/stdio.c | 2 | ||||
-rw-r--r-- | support/sys-statvfs.c | 10 |
3 files changed, 12 insertions, 6 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index de4f03f28d0..31db2470669 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,5 +1,11 @@ 2006-11-01 Jonathan Pryor <jonpryor@vt.edu> + * stdio.c: Some BSDs define clearerr(3) as a macro, so we need to cast + `stream' to a `FILE*' to avoid derefing a `void*'. + * sys-statvfs.c: Build fix to support OS X 10.3.9 & systems w/o statvfs(2). + +2006-11-01 Jonathan Pryor <jonpryor@vt.edu> + * mph.h: Add fallback typedefs for blkcnt_t, blksize_t, suseconds_t so that map.c can rely on their presence. (Some versions of OS X don't provide these typedefs.) diff --git a/support/stdio.c b/support/stdio.c index bd760c8ec59..0ab5a11243c 100644 --- a/support/stdio.c +++ b/support/stdio.c @@ -198,7 +198,7 @@ int Mono_Posix_Stdlib_clearerr (void* stream) { errno = 0; - clearerr (stream); + clearerr (((FILE*) stream)); return errno == 0 ? 0 : -1; } diff --git a/support/sys-statvfs.c b/support/sys-statvfs.c index 51416e57cbe..60fecdd92c5 100644 --- a/support/sys-statvfs.c +++ b/support/sys-statvfs.c @@ -149,25 +149,25 @@ Mono_Posix_ToStatvfs (void *_from, struct Mono_Posix_Statvfs *to) } int -Mono_Posix_FromStatvfs (struct Mono_Posix_Statvfs *from, void *to) +Mono_Posix_FromStatvfs (struct Mono_Posix_Statvfs *from, void *_to) { struct statfs *to = _to; + guint64 flag; to->f_bsize = from->f_bsize; - to->f_frsize = from->f_bsize; to->f_blocks = from->f_blocks; to->f_bfree = from->f_bfree; to->f_bavail = from->f_bavail; to->f_files = from->f_files; to->f_ffree = from->f_ffree; - to->f_favail = from->f_ffree; /* OSX doesn't have f_avail */ // from->f_fsid is an int32[2], to->f_fsid is a uint64, // so this shouldn't lose anything. memcpy (&to->f_fsid, &from->f_fsid, sizeof(to->f_fsid)); - if (Mono_Posix_FromMountFlags (from->f_flags, &to->f_flag) != 0) + if (Mono_Posix_FromMountFlags (from->f_flag, &flag) != 0) return -1; + to->f_flags = flag; return 0; } @@ -218,7 +218,7 @@ Mono_Posix_Syscall_fstatvfs (gint32 fd, struct Mono_Posix_Statvfs *buf) return -1; } - if ((r = statfs (path, &s)) == 0 && + if ((r = fstatfs (fd, &s)) == 0 && (r = Mono_Posix_ToStatvfs (&s, buf)) == 0) { set_fnamemax (fd, buf); } |