linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Yet another patch to lvm_dir_cache.c
@ 2000-08-03 16:33 William L. Jones
  0 siblings, 0 replies; only message in thread
From: William L. Jones @ 2000-08-03 16:33 UTC (permalink / raw)
  To: linux-lvm



linux-2.4-test5 problem.

lvm_dir_cache.c has a minor problem when it scans the output of 
/proc/partitions. It does not correctly skip the rest of the line.  The 
following patch fixes this problem:


[root@xfs lib]# diff -c lvm_dir_cache.c.orig lvm_dir_cache.c
*** lvm_dir_cache.c.orig        Mon Feb 21 20:09:32 2000
--- lvm_dir_cache.c     Thu Aug  3 11:11:04 2000
***************
*** 83,91 ****
      }

      if ( dir_cache == NULL) {
!       if ( ( proc = fopen ( "/proc/partitions", "r")) != NULL) {
            while ( !feof ( proc)) {
!              fscanf ( proc, " %s %s %s %s\n", major, minor, blocks, devname);
                if ( atoi ( major) > 0 && atoi ( major) != LVM_BLK_MAJOR) {
                   lvm_add_dir_cache ( "/dev", devname);
                }
--- 83,91 ----
      }

      if ( dir_cache == NULL) {
!       if (( proc = fopen ( "/proc/partitions", "r")) != NULL) {
            while ( !feof ( proc)) {
!              fscanf ( proc, " %s %s %s %s%*[^\n]s\n", major, minor, 
blocks, devname);
                if ( atoi ( major) > 0 && atoi ( major) != LVM_BLK_MAJOR) {
                   lvm_add_dir_cache ( "/dev", devname);
                }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-08-03 16:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-08-03 16:33 [linux-lvm] Yet another patch to lvm_dir_cache.c William L. Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).