info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mtools] patch: mtools SCO OpenServer SCSI compatibility


From: Bela Lubkin
Subject: [mtools] patch: mtools SCO OpenServer SCSI compatibility
Date: Fri, 27 Sep 2002 18:11:26 -0700

This patch (developed for http://mtools.linux.lu/mtools-3.9.8.tar.gz)
corrects SCO OpenServer compatibility with SCSI devices other than hard
disks.  The SCSIUSERCMD ioctl returns error information differently for
hard disks vs. other media.  Hard disks return -1 (errno EIO) for
certain errors, where other devices return 0 with host_sts and/or
target_sts nonzero.

>Bela<

--- scsi.c.orig Sun May 20 11:18:12 2001
+++ scsi.c      Fri Sep 27 18:11:25 2002
@@ -180,7 +180,7 @@
 
        return 0;  /* where to get scsi status? */
 
-#elif defined _SCO_DS
+#elif (defined _SCO_DS) && (defined SCSIUSERCMD)
        struct scsicmd scsi_cmd;
 
        memset(scsi_cmd.cdb, 0, SCSICMDLEN);    /* ensure zero pad */
@@ -190,8 +190,11 @@
        scsi_cmd.data_ptr = data;
        scsi_cmd.is_write = mode == SCSI_IO_WRITE;
        if (ioctl(fd,SCSIUSERCMD,&scsi_cmd) == -1) {
-               perror("scsi_io");
-               printf("scsi status: host=%x; target=%x\n",
+               perror("scsi_io: SCSIUSERCMD");
+               return -1;
+       }
+       if (scsi_cmd.host_sts != 0 || scsi_cmd.target_sts != 0) {
+               fprintf(stderr, "scsi_io: scsi status: host=%x; target=%x\n",
                (unsigned)scsi_cmd.host_sts,(unsigned)scsi_cmd.target_sts);
                return -1;
        }




[reminder to self: check http://www.tux.org/hypermail/mtools/ later]
_______________________________________________
mtools mailing list
address@hidden
http://www.tux.org/mailman/listinfo/mtools


reply via email to

[Prev in Thread] Current Thread [Next in Thread]