diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 1af64b844..fee8cbc26 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,19 @@ +1998-12-02 Sebastian Wilhelmi + + * 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 * direntry.c (vfs_s_new_super): Added the missing return value. diff --git a/vfs/direntry.c b/vfs/direntry.c index 1cbd7085b..4304370c0 100644 --- a/vfs/direntry.c +++ b/vfs/direntry.c @@ -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); diff --git a/vfs/fish.c b/vfs/fish.c index c7aa53c06..b0e860a5b 100644 --- a/vfs/fish.c +++ b/vfs/fish.c @@ -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); \ } diff --git a/vfs/tar.c b/vfs/tar.c index 8073e3f75..04cb7e4f7 100644 --- a/vfs/tar.c +++ b/vfs/tar.c @@ -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 { diff --git a/vfs/vfs.h b/vfs/vfs.h index 910af4209..08104a5b1 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -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 diff --git a/vfs/xdirentry.h b/vfs/xdirentry.h index 3590a22e3..c39408889 100644 --- a/vfs/xdirentry.h +++ b/vfs/xdirentry.h @@ -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