mirror of https://github.com/MidnightCommander/mc
* direntry.c (vfs_s_resolve_symlink): Comment out buggy code.
(vfs_s_retrieve_file): Set fh->handle to -1. (vfs_s_read): Don't manipulate with FH->handle if it is -1. (vfs_s_write): Likewise. (vfs_s_close): Likewise.
This commit is contained in:
parent
5f2ae160c0
commit
7df53e2bd2
|
@ -1,3 +1,11 @@
|
||||||
|
2002-03-06 Andrew V. Samoilov <kai@cmail.ru>
|
||||||
|
|
||||||
|
* direntry.c (vfs_s_resolve_symlink): Comment out buggy code.
|
||||||
|
(vfs_s_retrieve_file): Set fh->handle to -1.
|
||||||
|
(vfs_s_read): Don't manipulate with FH->handle if it is -1.
|
||||||
|
(vfs_s_write): Likewise.
|
||||||
|
(vfs_s_close): Likewise.
|
||||||
|
|
||||||
2002-02-27 Andrew V. Samoilov <kai@cmail.ru>
|
2002-02-27 Andrew V. Samoilov <kai@cmail.ru>
|
||||||
|
|
||||||
* samba/lib/debug.c: Remove syslog support.
|
* samba/lib/debug.c: Remove syslog support.
|
||||||
|
@ -23,11 +31,10 @@
|
||||||
|
|
||||||
* direntry.c (vfs_s_retrieve_file): Use off_t for total
|
* direntry.c (vfs_s_retrieve_file): Use off_t for total
|
||||||
and stat_size.
|
and stat_size.
|
||||||
|
(vfs_s_resolve_symlink): Use snprintf instead of sprintf.
|
||||||
|
|
||||||
* vfs.c (vfs_s_resolve_symlink): Use snprintf
|
* vfs.c (vfs_print_stats): Use off_t for have and need.
|
||||||
instead of sprintf.
|
Cast `have' to double to eliminate negative percent(s).
|
||||||
(vfs_print_stats): Use off_t for have and need. Cast
|
|
||||||
have to double to eliminate negative percent(s).
|
|
||||||
Fix print_vfs_message string formats.
|
Fix print_vfs_message string formats.
|
||||||
|
|
||||||
* vfs.h (vfs_print_stats): Adjust declaration.
|
* vfs.h (vfs_print_stats): Adjust declaration.
|
||||||
|
|
|
@ -87,9 +87,7 @@ vfs_s_free_inode (vfs *me, vfs_s_inode *ino)
|
||||||
/* ==0 can happen if freshly created entry is deleted */
|
/* ==0 can happen if freshly created entry is deleted */
|
||||||
if (ino->st.st_nlink <= 1){
|
if (ino->st.st_nlink <= 1){
|
||||||
while (ino->subdir){
|
while (ino->subdir){
|
||||||
vfs_s_entry *ent;
|
vfs_s_free_entry (me, ino->subdir);
|
||||||
ent = ino->subdir;
|
|
||||||
vfs_s_free_entry (me, ent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CALL (free_inode) (me, ino);
|
CALL (free_inode) (me, ino);
|
||||||
|
@ -395,7 +393,7 @@ vfs_s_resolve_symlink (vfs *me, vfs_s_entry *entry, char *path, int follow)
|
||||||
return (MEDATA->find_entry) (me, entry->dir, linkname, follow - 1, 0);
|
return (MEDATA->find_entry) (me, entry->dir, linkname, follow - 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ook, these were functions around direcory entries / inodes */
|
/* Ook, these were functions around directory entries / inodes */
|
||||||
/* -------------------------------- superblock games -------------------------- */
|
/* -------------------------------- superblock games -------------------------- */
|
||||||
|
|
||||||
vfs_s_super *
|
vfs_s_super *
|
||||||
|
@ -828,7 +826,7 @@ vfs_s_read (void *fh, char *buffer, int count)
|
||||||
if (FH->linear == LS_LINEAR_OPEN)
|
if (FH->linear == LS_LINEAR_OPEN)
|
||||||
return MEDATA->linear_read (me, FH, buffer, count);
|
return MEDATA->linear_read (me, FH, buffer, count);
|
||||||
|
|
||||||
if (FH->handle){
|
if (FH->handle != -1){
|
||||||
n = read (FH->handle, buffer, count);
|
n = read (FH->handle, buffer, count);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
me->verrno = errno;
|
me->verrno = errno;
|
||||||
|
@ -848,7 +846,7 @@ vfs_s_write (void *fh, char *buffer, int count)
|
||||||
vfs_die ("no writing to linear files, please");
|
vfs_die ("no writing to linear files, please");
|
||||||
|
|
||||||
FH->changed = 1;
|
FH->changed = 1;
|
||||||
if (FH->handle){
|
if (FH->handle != -1){
|
||||||
n = write (FH->handle, buffer, count);
|
n = write (FH->handle, buffer, count);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
me->verrno = errno;
|
me->verrno = errno;
|
||||||
|
@ -922,7 +920,7 @@ vfs_s_close (void *fh)
|
||||||
}
|
}
|
||||||
vfs_s_invalidate (me, FH_SUPER);
|
vfs_s_invalidate (me, FH_SUPER);
|
||||||
}
|
}
|
||||||
if (FH->handle)
|
if (FH->handle != -1)
|
||||||
close (FH->handle);
|
close (FH->handle);
|
||||||
|
|
||||||
vfs_s_free_inode (me, FH->ino);
|
vfs_s_free_inode (me, FH->ino);
|
||||||
|
@ -943,6 +941,7 @@ vfs_s_retrieve_file(vfs *me, struct vfs_s_inode *ino)
|
||||||
memset(&fh, 0, sizeof(fh));
|
memset(&fh, 0, sizeof(fh));
|
||||||
|
|
||||||
fh.ino = ino;
|
fh.ino = ino;
|
||||||
|
fh.handle = -1;
|
||||||
|
|
||||||
handle = mc_mkstemps (&ino->localname, me->name, NULL);
|
handle = mc_mkstemps (&ino->localname, me->name, NULL);
|
||||||
if (handle == -1) {
|
if (handle == -1) {
|
||||||
|
|
Loading…
Reference in New Issue