Просмотр исходного кода

Thu Oct 22 20:41:50 1998 Norbert Warmuth <nwarmuth@privat.circular.de>

*  configure.in (subshell): Don't define inline to be empty
when compiling with non-gcc compiler. AC_C_INLINE (invoked in
AM_GETTEXT_GNU) already defines inline if necessary.

Thu Oct 22 20:41:16 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>

* panelize.c (do_external_panelize): Not zeroing some fields
in cpanel led sometimes to segfaults.

Thu Oct 22 20:30:28 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>

* vfs/ftpfs.c (resolve_symlink, retrieve_dir): Don't timeout and
free dcache while resolving symlinks (i.e. don't free some
pointers which are in use by resolve_symlink).
Norbert Warmuth 26 лет назад
Родитель
Сommit
96f4d6c760
6 измененных файлов с 29 добавлено и 4 удалено
  1. 1 1
      configure.in
  2. 11 0
      src/ChangeLog
  3. 5 1
      src/panelize.c
  4. 6 0
      vfs/ChangeLog
  5. 5 2
      vfs/ftpfs.c
  6. 1 0
      vfs/ftpfs.h

+ 1 - 1
configure.in

@@ -888,7 +888,7 @@ dnl
 if test x$GCC = x
 then
 	AC_DEFINE(OLD_TOOLS)
-	CPPFLAGS="$CPPFLAGS -Dinline="
+	CPPFLAGS="$CPPFLAGS"
 fi
 
 dnl

+ 11 - 0
src/ChangeLog

@@ -1,3 +1,14 @@
+Thu Oct 22 20:41:50 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	*  configure.in (subshell): Don't define inline to be empty
+	when compiling with non-gcc compiler. AC_C_INLINE (invoked in
+	AM_GETTEXT_GNU) already defines inline if necessary.
+
+Thu Oct 22 20:41:16 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	* panelize.c (do_external_panelize): Not zeroing some fields
+	in cpanel led sometimes to segfaults.
+
 Thu Oct 22 20:31:17 1998  Pavel Roskin  <pavel_roskin@geocities.com>
 
 	* lib/mc.ext.in: *.jar and *.JAR treated like *.zip and *.ZIP

+ 5 - 1
src/panelize.c

@@ -409,6 +409,9 @@ void do_external_panelize (char *command)
     /* Clear the counters */
     cpanel->total = cpanel->dirs_marked = cpanel->marked = 0;
     cpanel->has_dir_sizes = 0;
+    cpanel->top_file = 0;
+    cpanel->selected = 0;
+
     while (1) {
 	clearerr(external);
 	if (fgets (line, MC_MAXPATHLEN, external) == NULL) {
@@ -442,9 +445,10 @@ void do_external_panelize (char *command)
 	if (!(next_free & 32))
 	    rotate_dash ();
     }
+
+    cpanel->is_panelized = 1;
     if (next_free){
 	cpanel->count = next_free;
-	cpanel->is_panelized = 1;
 	if (list->list [0].fname [0] == PATH_SEP){
 	    strcpy (cpanel->cwd, PATH_SEP_STR);
 	    chdir (PATH_SEP_STR);

+ 6 - 0
vfs/ChangeLog

@@ -1,3 +1,9 @@
+Thu Oct 22 20:30:28 1998  Norbert Warmuth  <nwarmuth@privat.circular.de>
+
+	* ftpfs.c (resolve_symlink, retrieve_dir): Don't timeout and
+	free dcache while resolving symlinks (i.e. don't free some
+	pointers which are in use by resolve_symlink). 
+
 Mon Oct 19 11:44:47 1998  Pavel Machek  <pavel@atrey.karlin.mff.cuni.cz>
 
 	* mcfs.c: prefix is mc:, not mcfs:. So now mcfs actually works.

+ 5 - 2
vfs/ftpfs.c

@@ -1038,7 +1038,7 @@ resolve_symlink(struct connection *bucket, struct dir *dir)
     
     print_vfs_message("Resolving symlink...");
 
-    dir->symlink_status = FTPFS_RESOLVED_SYMLINKS;
+    dir->symlink_status = FTPFS_RESOLVING_SYMLINKS;
     for (flist = dir->file_list->next; flist != dir->file_list; flist = flist->next) {
         /* flist->data->l_stat is alread initialized with 0 */
         fel = flist->data;
@@ -1089,6 +1089,8 @@ resolve_symlink(struct connection *bucket, struct dir *dir)
 	    }
         }
     }
+    dir->symlink_status = FTPFS_RESOLVED_SYMLINKS;
+
 }
 
 
@@ -1130,7 +1132,8 @@ retrieve_dir(struct connection *bucket, char *remote_path, int resolve_symlinks)
 	    struct timeval tim;
 
 	    gettimeofday(&tim, NULL);
-	    if ((tim.tv_sec < dcache->timestamp.tv_sec) && !force_expiration) {
+	    if (((tim.tv_sec < dcache->timestamp.tv_sec) && !force_expiration)
+                || dcache->symlink_status == FTPFS_RESOLVING_SYMLINKS) {
                 if (resolve_symlinks && dcache->symlink_status == FTPFS_UNRESOLVED_SYMLINKS)
 	            resolve_symlink(bucket, dcache);
 		return dcache;

+ 1 - 0
vfs/ftpfs.h

@@ -36,6 +36,7 @@ struct dir
 #define FTPFS_NO_SYMLINKS          0
 #define FTPFS_UNRESOLVED_SYMLINKS  1
 #define FTPFS_RESOLVED_SYMLINKS    2
+#define FTPFS_RESOLVING_SYMLINKS   3 
 
 struct connection {
     char *host;