Index: Makefile.in =================================================================== RCS file: /home/cvsroot/scsidev/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Makefile.in 2000/02/14 22:54:03 1.8 +++ Makefile.in 2000/09/05 09:22:35 1.9 @@ -1,5 +1,5 @@ # -# $Id: Makefile.in,v 1.8 2000/02/14 22:54:03 garloff Exp $ +# $Id: Makefile.in,v 1.9 2000/09/05 09:22:35 garloff Exp $ # ## Makefile for scsidev. @@ -18,10 +18,11 @@ VERSION = $(shell cat VERSION) -prefix = /usr -exec_prefix = +prefix = $(DESTDIR)/usr +exec_prefix = $(DESTDIR) bindir = $(exec_prefix)/bin +docdir = $(prefix)/share/doc/packages # Where to put the manual pages. mandir = $(prefix)/share/man/man8 @@ -50,9 +51,9 @@ install -o root -g root -m 755 -s scsidev $(bindir) install -o root -g root -m 644 scsidev.8 $(mandir) gzip -9f $(mandir)/scsidev.8 - if [ ! -d /dev/scsi ]; then mkdir /dev/scsi; fi - #install -d /usr/doc/packages/scsidev - #install COPYING boot.diff README scsi.alias /usr/doc/packages/scsidev/ + if [ ! -d $(DESTDIR)/dev/scsi ]; then mkdir $(DESTDIR)/dev/scsi; fi + #install -d $(docdir)/scsidev + #install COPYING boot.diff README scsi.alias $(docdir)/scsidev/ dist: clean rm Makefile Index: VERSION =================================================================== RCS file: /home/cvsroot/scsidev/VERSION,v retrieving revision 1.6 retrieving revision 1.8 diff -u -r1.6 -r1.8 --- VERSION 2000/07/14 23:46:44 1.6 +++ VERSION 2000/09/04 18:43:11 1.8 @@ -1 +1 @@ -2.20 +2.22 Index: scsidev.c =================================================================== RCS file: /home/cvsroot/scsidev/scsidev.c,v retrieving revision 1.26 retrieving revision 1.28 diff -u -r1.26 -r1.28 --- scsidev.c 2000/07/14 23:59:35 1.26 +++ scsidev.c 2000/09/04 18:43:01 1.28 @@ -56,7 +56,11 @@ * honoured by most of Linux' SCSI high-level drivers :-( * - Add support for OnStream tapes (osst) * -> Version 2.20 - * + * + * * 2000/09/04: Kurt Garloff + * - Bugfix for long hostnames from Doug Gilbert (=> 2.21) + * - Fix parsing of scsi.alias file: Broke on missing LF at the end + * -> 2.22 */ #include @@ -73,7 +77,7 @@ #include -static char rcsid[] ="$Id: scsidev.c,v 1.26 2000/07/14 23:59:35 garloff Exp $"; +static char rcsid[] ="$Id: scsidev.c,v 1.28 2000/09/04 18:43:01 garloff Exp $"; static char *versid = "scsidev " VERSION " 2000/01/17"; static char *copyright = "Copyright: GNU GPL (see file COPYING)\n" \ " (w) 1994--1997 Eric Youngdale \n"\ @@ -583,6 +587,7 @@ *(int*)hostname = 63; status = ioctl (fd, SCSI_IOCTL_PROBE_HOST, hostname); + hostname[63] = '\0'; //close (fd); spnt->hostname = strdup (hostname); @@ -1099,9 +1104,9 @@ } break; } - /* - * Isn't a digit. Must be the end of the number. - */ + /* + * Isn't a digit. Must be the end of the number. + */ break; } while (*pnt == ' ' || *pnt == '\t') pnt++; @@ -1164,19 +1169,20 @@ line = 0; while (1) { + *buffer = 0; fgets (buffer, sizeof(buffer), configfile); line++; - if (feof (configfile)) break; - - /* - * Remove trailing \n, if present. - */ + if (feof (configfile) && !*buffer) break; + + /* + * Remove trailing \n, if present. + */ pnt = buffer + strlen(buffer) - 1; if( *pnt == '\n' ) *pnt = '\0'; - /* - * First, tokenize the input line, and pick out the parameters. - */ + /* + * First, tokenize the input line, and pick out the parameters. + */ lun = -1; id = -1; chan = -1; hostid = -1; hostnum = -1; @@ -1189,7 +1195,7 @@ pnt = buffer; while (*pnt == ' ' || *pnt == '\t') pnt++; - /* allow blank lines and comments... */ + /* allow blank lines and comments... */ if( *pnt == '\0' ) continue; if( *pnt == '#' ) continue; @@ -1291,10 +1297,10 @@ continue; } - /* - * OK, minimal requirements are met. Try and match this to something - * we know about already. - */ + /* + * OK, minimal requirements are met. Try and match this to something + * we know about already. + */ match = NULL; for (spnt = reglist; spnt; spnt = spnt->next) { @@ -1353,13 +1359,13 @@ else match = spnt; } - - /* - * See if there was a non-unique mapping. If so, then - * don't do anything for this one. - */ - // detect break + /* + * See if there was a non-unique mapping. If so, then + * don't do anything for this one. + */ + + // detect break if( spnt != NULL ) continue; @@ -1537,7 +1543,7 @@ memset (buffer, 0, sizeof(buffer)); - *( (int *) buffer ) = 0; /* length of input data */ + *( (int *) buffer ) = 0; /* length of input data */ *( ((int *) buffer) + 1 ) = sizeof(buffer)-16; /* length of output buffer */ cmd = (char *) ( ((int *) buffer) + 2 );