mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* 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:
parent
34947b1819
commit
534e8f432a
@ -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
|
||||
|
39
vfs/vfs.c
39
vfs/vfs.c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user