* vfs.c: Manually expand macros for mc_stat(), mc_lstat() and

mc_fstat() because they don't expand correctly on Solaris 8 with
large file support.
This commit is contained in:
Pavel Roskin 2001-09-17 21:29:51 +00:00
parent 34947b1819
commit 534e8f432a
2 changed files with 42 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2001-09-17 Pavel Roskin <proski@gnu.org>
* vfs.c: Manually expand macros for mc_stat(), mc_lstat() and
mc_fstat() because they don't expand correctly on Solaris 8 with
large file support.
2001-09-10 Pavel Roskin <proski@gnu.org>
* Make-mc.in: Use USE_VFS conditional instead of relying on

View File

@ -587,9 +587,42 @@ mc_closedir (DIR *dirp)
return result;
}
MC_NAMEOP (stat, (char *path, struct stat *buf), (vfs, vfs_name (path), buf))
MC_NAMEOP (lstat, (char *path, struct stat *buf), (vfs, vfs_name (path), buf))
MC_HANDLEOP (fstat, (int handle, struct stat *buf), (vfs_info (handle), buf))
int mc_stat (char *path, struct stat *buf) {
vfs *vfs;
int result;
path = vfs_canon (path); vfs = vfs_type (path);
result = vfs->stat ? (*vfs->stat) (vfs, vfs_name (path), buf) : -1;
g_free (path);
if (result == -1)
errno = vfs->name ? ferrno (vfs) : E_NOTSUPP;
return result;
}
int mc_lstat (char *path, struct stat *buf) {
vfs *vfs;
int result;
path = vfs_canon (path); vfs = vfs_type (path);
result = vfs->lstat ? (*vfs->lstat) (vfs, vfs_name (path), buf) : -1;
g_free (path);
if (result == -1)
errno = vfs->name ? ferrno (vfs) : E_NOTSUPP;
return result;
}
int mc_fstat (int handle, struct stat *buf) {
vfs *vfs;
int result;
if (handle == -1)
return -1;
vfs = vfs_op (handle);
result = vfs->fstat ? (*vfs->fstat) (vfs_info (handle), buf) : -1;
if (result == -1)
errno = vfs->name ? ferrno (vfs) : E_NOTSUPP;
return result;
}
/*
* You must g_strdup whatever this function returns, static buffers are in use