OSDN Git Service

ChangeLog, fsck.c, mke2fs.c, partinfo.c:
authorTheodore Ts'o <tytso@mit.edu>
Wed, 2 Feb 2000 19:08:51 +0000 (19:08 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 2 Feb 2000 19:08:51 +0000 (19:08 +0000)
  fsck.c (interpret_device): If there was an attempt to interpret a
   device specification of the type "UUID=" or "LABEL=", and it fails,
   check to see if /proc/partitions is readable.  If not, print a warning
   message about /proc perhaps not being mounted, and exit.
  mke2fs.c (check_plausibility): Remove unneeded #include of linux/fs.h.
   Add #define of MAJOR if necessary.
  partinfo.c: Remove unneeded #include of linux/fs.h

misc/ChangeLog
misc/fsck.c
misc/mke2fs.c
misc/partinfo.c

index cea78ab..f78ec95 100644 (file)
@@ -1,3 +1,16 @@
+2000-02-02  Theodore Ts'o  <tytso@valinux.com>
+
+       * fsck.c (interpret_device): If there was an attempt to interpret
+               a device specification of the type "UUID=" or "LABEL=",
+               and it fails, check to see if /proc/partitions is
+               readable.  If not, print a warning message about /proc
+               perhaps not being mounted, and exit.
+
+       * mke2fs.c (check_plausibility): Remove unneeded #include of
+               linux/fs.h.  Add #define of MAJOR if necessary.
+
+       * partinfo.c: Remove unneeded #include of linux/fs.h
+
 2000-01-19  Theodore Ts'o  <tytso@valinux.com>
 
        * tune2fs.c (usage): Update the usage message to correctly
index 349a74c..9b42820 100644 (file)
@@ -257,9 +257,21 @@ static char *interpret_device(char *spec)
                dev = get_spec_by_uuid(spec+5);
        else if (!strncmp(spec, "LABEL=", 6))
                dev = get_spec_by_volume_label(spec+6);
+       else
+               return spec;
        if (dev) {
                free(spec);
-               spec = dev;
+               return (dev);
+       }
+       /*
+        * Check to see if this was because /proc/partitions isn't
+        * found.
+        */
+       if (access("/proc/partitions", R_OK) < 0) {
+               fprintf(stderr, "Couldn't open /proc/partitions: %s\n",
+                       strerror(errno));
+               fprintf(stderr, "Is /proc mounted?\n");
+               exit(1);
        }
        return spec;
 }
index df0b878..ef62722 100644 (file)
@@ -41,9 +41,6 @@
 #include <sys/ioctl.h>
 #include <sys/types.h>
 
-#ifdef HAVE_LINUX_FS_H
-#include <linux/fs.h>
-#endif
 #include <linux/ext2_fs.h>
 #ifdef HAVE_LINUX_MAJOR_H
 #include <linux/major.h>
@@ -138,6 +135,11 @@ static void proceed_question(NOARGS)
 static void check_plausibility(NOARGS)
 {
 #ifdef HAVE_LINUX_MAJOR_H
+#ifndef MAJOR
+#define MAJOR(dev)     ((dev)>>8)
+#define MINOR(dev)     ((dev) & 0xff)
+#endif
+
        int val;
        struct stat s;
        
index 6ae850f..588a631 100644 (file)
@@ -10,7 +10,6 @@
 #include <sys/types.h>
 #include <fcntl.h>
 #include <stdio.h>
-#include <linux/fs.h>
 #include <linux/hdreg.h>
 #include <unistd.h>
 #include <stdlib.h>