Index: TODO =================================================================== RCS file: /home/cvsroot/scsidev/TODO,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -u -r1.3.2.1 -r1.3.2.2 --- TODO 4 Oct 2002 12:22:04 -0000 1.3.2.1 +++ TODO 29 Jun 2003 20:47:13 -0000 1.3.2.2 @@ -1,4 +1,4 @@ -TODO ($Id: TODO,v 1.3.2.1 2002/10/04 12:22:04 garloff Exp $) +TODO ($Id: TODO,v 1.3.2.2 2003/06/29 20:47:13 garloff Exp $) ==== * Update README file. @@ -13,4 +13,4 @@ This should be even more safe. => DONE in 2.25. Probably this could be done in a little perl or bash script. - +* Use sysfs for 2.5/2.6 kernels. Index: VERSION =================================================================== RCS file: /home/cvsroot/scsidev/VERSION,v retrieving revision 1.8.2.6 retrieving revision 1.8.2.7 diff -u -r1.8.2.6 -r1.8.2.7 --- VERSION 4 Oct 2002 09:26:47 -0000 1.8.2.6 +++ VERSION 29 Jun 2003 20:43:05 -0000 1.8.2.7 @@ -1 +1 @@ -2.28 +2.29 Index: scsidev.c =================================================================== RCS file: /home/cvsroot/scsidev/scsidev.c,v retrieving revision 1.28.2.21 diff -u -r1.28.2.21 scsidev.c --- scsidev.c 4 Oct 2002 12:42:09 -0000 1.28.2.21 +++ scsidev.c 30 Jun 2003 11:28:04 -0000 @@ -106,6 +106,18 @@ * - Multipathing support * - Fix Medium Changer (and other device types with spaces) detection * -> 2.28 + * + * * 2003-01-13: Kurt Garloff + * - Handle EOF return value from sscanf() + * - Handle empty names gracefully (for zfcp, from Bernd Kaindl) + * * 2003-03-07: Kurt Garloff + * - Fix symlinks to partitions (patch from Suresh Grandhi + * ) + * * 2003-06-29: Kurt Garloff + * - Fix fd leak (/proc/partitions) + * * 2003-06-30: Kurt Garloff + * - Empty name protection (2003-01-13) was faulty: Test was reversed. + * -> 2.29 */ #include @@ -126,11 +138,11 @@ #include -static char rcsid[] ="$Id: scsidev.c,v 1.28.2.21 2002/10/04 12:42:09 garloff Exp $"; +static char rcsid[] ="$Id: scsidev.c,v 1.28.2.26 2003/06/30 11:24:48 garloff Exp $"; static char *versid = "scsidev " VERSION " 2002-10-04"; static char *copyright = "Copyright: GNU GPL (see file COPYING)\n" \ " (w) 1994--1997 Eric Youngdale \n"\ -" 2000--2002 Kurt Garloff "; +" 2000--2003 Kurt Garloff "; #include "config.h" @@ -1631,6 +1643,7 @@ } } } + fclose (pf); } @@ -1736,7 +1749,7 @@ spnt = malloc (sizeof (sname)); memset (spnt, 0, sizeof (sname)); hl_per_dev = procscsi_parse (spnt); - if (!hl_per_dev) { + if (!hl_per_dev || hl_per_dev == EOF) { free (spnt); fprintf (stderr, "Low level dev without HL driver?\n"); continue; @@ -1758,20 +1771,23 @@ else fill_in_proc (spnt); if (!sgpnt) - sgpnt = spnt; + sgpnt = spnt; /* Copy info to the colleagues * and do special stuff depending on dev types. Such as the non-rew. * variant for tapes or the partitions on disks */ for (hl = 0; hl < hl_per_dev; ++hl, spnt = spnt->next) { if (spnt != sgpnt) { - spnt->serial = strdup (sgpnt->serial); + if (sgpnt->serial) + spnt->serial = strdup (sgpnt->serial); spnt->wwid = sgpnt->wwid; spnt->rmvbl = sgpnt->rmvbl; //spnt->unsafe = sgpnt->unsafe; spnt->hostid = sgpnt->hostid; - spnt->hostname = strdup (sgpnt->hostname); - spnt->shorthostname = strdup (sgpnt->shorthostname); + if (sgpnt->hostname) + spnt->hostname = strdup (sgpnt->hostname); + if (sgpnt->shorthostname) + spnt->shorthostname = strdup (sgpnt->shorthostname); spnt->related = sgpnt; } /* This does the handling of the dev nodes */