1998-12-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>

* fish.c (FISH_OP): changed snprintf to g_snprintf, as glib is
        used anyway.

        * xdirentry.h (LINK_NO_FOLLOW):
        * tar.c (read_header):
        * direntry.c (vfs_s_resolve_symlink):
        (vfs_s_inode_from_path):
        (vfs_s_open): renamed NO_FOLLOW and FOLLOW to LINK_NO_FOLLOW and
        LINK_FOLLOW resp. to avoid problems on solaris, where FOLLOW and
        NO_FOLLOW are defined in an enum.

        * vfs.h (ELAST): define it to 300, if not already defined, thats a
        bad hack, but what can we do....
This commit is contained in:
Sebastian Wilhelmi 1998-12-02 13:17:24 +00:00
parent c983d57dd2
commit 8b8a943b6e
6 changed files with 29 additions and 9 deletions

View File

@ -1,3 +1,19 @@
1998-12-02 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* fish.c (FISH_OP): changed snprintf to g_snprintf, as glib is
used anyway.
* xdirentry.h (LINK_NO_FOLLOW):
* tar.c (read_header):
* direntry.c (vfs_s_resolve_symlink):
(vfs_s_inode_from_path):
(vfs_s_open): renamed NO_FOLLOW and FOLLOW to LINK_NO_FOLLOW and
LINK_FOLLOW resp. to avoid problems on solaris, where FOLLOW and
NO_FOLLOW are defined in an enum.
* vfs.h (ELAST): define it to 300, if not already defined, thats a
bad hack, but what can we do....
Wed Dec 2 14:06:49 KST 1998 Sung-Hyun Nam <namsh@lgic.co.kr>
* direntry.c (vfs_s_new_super): Added the missing return value.

View File

@ -319,7 +319,7 @@ vfs_s_inode *vfs_s_find_root(vfs *me, vfs_s_entry *entry)
vfs_s_entry *vfs_s_resolve_symlink (vfs *me, vfs_s_entry *entry, int follow)
{
vfs_s_inode *dir;
if (follow == -1)
if (follow == LINK_NO_FOLLOW)
return entry;
if (follow == 0)
ERRNOR (ELOOP, NULL);
@ -500,7 +500,7 @@ vfs_s_inode *vfs_s_inode_from_path (vfs *me, char *name, int flags)
if (!(q = vfs_s_get_path_mangle (me, name, &super, 0)))
return NULL;
ino = vfs_s_find_inode (me, super->root, q, flags & FL_FOLLOW ? FOLLOW : NO_FOLLOW, flags & ~FL_FOLLOW);
ino = vfs_s_find_inode (me, super->root, q, flags & FL_FOLLOW ? LINK_FOLLOW : LINK_NO_FOLLOW, flags & ~FL_FOLLOW);
if (ino) return ino;
return ino;
@ -653,7 +653,7 @@ void *vfs_s_open (vfs *me, char *file, int flags, int mode)
if ((q = vfs_s_get_path_mangle (me, file, &super, 0)) == NULL)
return NULL;
ino = vfs_s_find_inode (me, super->root, q, FOLLOW, FL_NONE);
ino = vfs_s_find_inode (me, super->root, q, LINK_FOLLOW, FL_NONE);
if (ino && ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)))
ERRNOR (EEXIST, NULL);
if (!ino) {
@ -664,7 +664,7 @@ void *vfs_s_open (vfs *me, char *file, int flags, int mode)
return NULL;
split_dir_name(me, q, &dirname, &name, &save);
dir = vfs_s_find_inode(me, super->root, dirname, FOLLOW, FL_DIR);
dir = vfs_s_find_inode(me, super->root, dirname, LINK_FOLLOW, FL_DIR);
if (save)
*save = DIR_SEP_CHAR;
ent = vfs_s_generate_entry (me, name, dir, 0755);

View File

@ -623,7 +623,7 @@ static int fish_##name (vfs *me, char *path1, char *path2) \
return -1; \
if (!(rpath2 = vfs_s_get_path_mangle(me, path2, &super2, 0))) \
return -1; \
snprintf(buf, 1023, string "\n", rpath1, rpath2, rpath1, rpath2 ); \
g_snprintf(buf, 1023, string "\n", rpath1, rpath2, rpath1, rpath2 ); \
return send_fish_command(me, super2, buf, OPT_FLUSH); \
}

View File

@ -327,14 +327,14 @@ static int read_header (vfs *me, vfs_s_super *archive, int tard)
q = current_file_name;
}
parent = vfs_s_find_inode (me, archive->root, q, NO_FOLLOW, FL_MKDIR);
parent = vfs_s_find_inode (me, archive->root, q, LINK_NO_FOLLOW, FL_MKDIR);
if (parent == NULL) {
message_1s (1, MSG_ERROR, _("Inconsistent tar archive"));
return 0;
}
if (header->header.linkflag == LF_LINK) {
parent = vfs_s_find_inode (me, archive->root, current_link_name, NO_FOLLOW, 0);
parent = vfs_s_find_inode (me, archive->root, current_link_name, LINK_NO_FOLLOW, 0);
if (parent == NULL) {
message_1s (1, MSG_ERROR, _("Inconsistent tar archive"));
} else {

View File

@ -403,6 +403,10 @@ extern void mc_vfs_done( void );
/* And now some defines for our errors. */
#ifndef ELAST
#define ELAST 300 /* bad hack, but what can we do */
#endif
#ifdef ENOSYS
#define E_NOTSUPP ENOSYS /* for use in vfs when module does not provide function */
#else

View File

@ -22,8 +22,8 @@
#include "vfs.h"
#define FOLLOW 15
#define NO_FOLLOW -1
#define LINK_FOLLOW 15
#define LINK_NO_FOLLOW -1
/* For vfs_s_find_entry */
#define FL_NONE 0