1
1

2000-10-09 Andrew V. Samoilov <sav@bcs.zp.ua>

* sfs.c (redirect): temporary file unlinked on error;

	(sfs_init): warnings are localized
Этот коммит содержится в:
Andrew V. Samoilov 2000-10-09 22:45:50 +00:00
родитель ed0753665b
Коммит 1f6dc4fe5a

Просмотреть файл

@ -3,6 +3,8 @@
* *
* Copyright 1998 Pavel Machek, distribute under GPL * Copyright 1998 Pavel Machek, distribute under GPL
* *
* $Id$
*
* This defines whole class of filesystems which contain single file * This defines whole class of filesystems which contain single file
* inside. It is somehow similar to extfs, except that extfs makes * inside. It is somehow similar to extfs, except that extfs makes
* whole virtual trees and we do only single virtual files. * whole virtual trees and we do only single virtual files.
@ -146,6 +148,8 @@ redirect (vfs *me, char *name)
return cache; return cache;
} }
unlink (cache);
g_free (cache); g_free (cache);
return "/I_MUST_NOT_EXIST"; return "/I_MUST_NOT_EXIST";
} }
@ -177,7 +181,7 @@ static int sfs_lstat (vfs *me, char *path, struct stat *buf)
{ {
path = redirect (me, path); path = redirect (me, path);
#ifndef HAVE_STATLSTAT #ifndef HAVE_STATLSTAT
return lstat (path,buf); return lstat (path, buf);
#else #else
return statlstat (path, buf); return statlstat (path, buf);
#endif #endif
@ -294,7 +298,7 @@ static int sfs_init (vfs *me)
FILE *cfg = fopen (LIBDIR "extfs/sfs.ini", "r"); FILE *cfg = fopen (LIBDIR "extfs/sfs.ini", "r");
if (!cfg){ if (!cfg){
fprintf (stderr, "Warning: " LIBDIR "extfs/sfs.ini not found\n"); fprintf (stderr, _("Warning: %sextfs/sfs.ini not found\n"), LIBDIR);
return 0; return 0;
} }
@ -321,7 +325,7 @@ static int sfs_init (vfs *me)
} }
if (!semi){ if (!semi){
fprintf (stderr, "Warning: Invalid line %s in sfs.ini.\n", key); fprintf (stderr, _("Warning: Invalid line %s in sfs.ini.\n"), key);
continue; continue;
} }
@ -332,7 +336,7 @@ static int sfs_init (vfs *me)
case '2': flags |= F_2; break; case '2': flags |= F_2; break;
case 'R': flags |= F_NOLOCALCOPY; break; case 'R': flags |= F_NOLOCALCOPY; break;
default: default:
fprintf (stderr, "Warning: Invalid flag %c in sfs.ini line %s.\n", *c, key); fprintf (stderr, _("Warning: Invalid flag %c in sfs.ini line %s.\n"), *c, key);
} }
c++; c++;
} }
@ -376,13 +380,12 @@ sfs_which (vfs *me, char *path)
if (!strncmp (path, sfs_prefix [i], strlen (sfs_prefix [i]))) if (!strncmp (path, sfs_prefix [i], strlen (sfs_prefix [i])))
return i; return i;
return -1; return -1;
} }
vfs vfs_sfs_ops = { vfs vfs_sfs_ops = {
NULL, /* This is place of next pointer */ NULL, /* This is place of next pointer */
"Signle file filesystems", N_ ("Signle file filesystems"),
F_EXEC, /* flags */ F_EXEC, /* flags */
NULL, /* prefix */ NULL, /* prefix */
NULL, /* data */ NULL, /* data */