]> git.wh0rd.org - dump.git/commitdiff
Fix a compile problem (e2fs label related).
authorStelian Pop <stelian@popies.net>
Thu, 30 Nov 2000 09:53:10 +0000 (09:53 +0000)
committerStelian Pop <stelian@popies.net>
Thu, 30 Nov 2000 09:53:10 +0000 (09:53 +0000)
CHANGES
compat/include/bylabel.h
compat/lib/bylabel.c
dump/main.c

diff --git a/CHANGES b/CHANGES
index bb5f3c881ee6e0043de31a6a50148ca475f6a024..5d690aa6c474e78bc0779c2441923403c5b82fdc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.91 2000/11/29 10:13:41 stelian Exp $
+$Id: CHANGES,v 1.92 2000/11/30 09:53:10 stelian Exp $
 
 Changes between versions 0.4b20 and 0.4b21 (released ?????????????????)
 =======================================================================
@@ -7,6 +7,10 @@ Changes between versions 0.4b20 and 0.4b21 (released ?????????????????)
        the previous version. Thanks to Andreas Dilger 
        <adilger@turbolinux.com> for his help on this one.
 
+2.     Fixed again a compilation problem when using old e2fs
+       headers (filesystem label related). Thanks to many users
+       who reported this stupid error.
+
 Changes between versions 0.4b19 and 0.4b20 (released November 10, 2000)
 =======================================================================
 
index 00ed284a3241d1f853bec4c85dc081990b5bdf27..67b6ddaaa99b26993937714f2077a4e2a07d21c6 100644 (file)
@@ -1 +1,23 @@
+/*
+ *     Ported to Linux's Second Extended File System as part of the
+ *     dump and restore backup suit
+ *     1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
+ *      - added Native Language Support
+ *     2000-01-20 James Antill <james@and.org>
+ *      - Added error message if /proc/partitions cannot be opened
+ *     2000-05-09 Erik Troan <ewt@redhat.com>
+ *     - Added cache for UUID and disk labels
+ *     Wed Aug 16 2000 Erik Troan <ewt@redhat.com>
+ *     - Ported to dump/restore
+ *     Stelian Pop <pop@cybercable.fr> - Alcôve <www.alcove.fr>, 2000
+ *
+ *     $Id: bylabel.h,v 1.2 2000/11/30 09:53:13 stelian Exp $
+ */
+
+#ifndef _BYLABEL_H_
+#define        _BYLABEL_H_
+
 const char * get_device_name(const char * item);
+const char * get_device_label(const char * spec);
+
+#endif /* !_BYLABEL_H_ */
index c91457d3d232d7b47ff0209dc2a7c0531c79d4c6..978a39d1d6ff358dc4c47151410a83c4943ca6b0 100644 (file)
@@ -229,3 +229,18 @@ get_device_name(const char * item) {
 
        return rc;
 }
+
+const char *
+get_device_label(const char * spec) {
+       struct uuidCache_s *uc;
+
+       uuidcache_init();
+       uc = uuidCache;
+
+       while(uc) {
+               if (!strcmp(spec, uc->device))
+                       return uc->label[0] == '\0' ? NULL : strdup(uc->label);
+               uc = uc->next;
+       }
+       return NULL;
+}
index b981cd8c92aa6f098c5d1b2116254bfe8a3c258e..9f61fb686edcc4ae6ff56b6e201eb146eeb16c9d 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.29 2000/11/10 14:42:25 stelian Exp $";
+       "$Id: main.c,v 1.30 2000/11/30 09:53:14 stelian Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -513,8 +513,9 @@ main(int argc, char *argv[])
        }
        /* if no user label specified, use ext2 filesystem label if available */
        if (spcl.c_label[0] == '\0') {
-               if (fs->super->s_volume_name[0] != '\0') {
-                       strncpy(spcl.c_label, fs->super->s_volume_name,LBLSIZE);
+               const char *lbl;
+               if ( (lbl = get_device_label(disk)) != NULL) {
+                       strncpy(spcl.c_label, lbl, LBLSIZE);
                        spcl.c_label[LBLSIZE-1] = '\0';
                }
                else