diff options
author | groo <groo> | 2000-03-06 21:14:50 +0000 |
---|---|---|
committer | groo <groo> | 2000-03-06 21:14:50 +0000 |
commit | 455cae3bcbe9c6e08a7117a5bdcdccb8dcc196ee (patch) | |
tree | b6f2170e7139162278bacd128265f9ed132f5335 /sysutils | |
parent | bd66ba2e2435c9c4f0b01ca205d07605e32c4f25 (diff) | |
download | pkgsrc-455cae3bcbe9c6e08a7117a5bdcdccb8dcc196ee.tar.gz |
Allow amanda to build with either the 1.4 chio.h or the post-comdex
chio.h. Note: I do *not* own a SCSI tape changer. Testing appreciated!
This patch continues to use the old ioctl on new systems. If it worked
before, it should continue to work.
Fixes PR pkg/8651.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/amanda-client/files/patch-sum | 3 | ||||
-rw-r--r-- | sysutils/amanda-client/patches/patch-ag | 163 | ||||
-rw-r--r-- | sysutils/amanda-common/files/patch-sum | 3 | ||||
-rw-r--r-- | sysutils/amanda-common/patches/patch-ae | 163 | ||||
-rw-r--r-- | sysutils/amanda-server/files/patch-sum | 3 | ||||
-rw-r--r-- | sysutils/amanda-server/patches/patch-ai | 163 |
6 files changed, 495 insertions, 3 deletions
diff --git a/sysutils/amanda-client/files/patch-sum b/sysutils/amanda-client/files/patch-sum index a21dacc2157..74fe127b56c 100644 --- a/sysutils/amanda-client/files/patch-sum +++ b/sysutils/amanda-client/files/patch-sum @@ -1,4 +1,4 @@ -$NetBSD: patch-sum,v 1.3 1999/09/06 18:09:05 bad Exp $ +$NetBSD: patch-sum,v 1.4 2000/03/06 21:14:51 groo Exp $ MD5 (patch-aa) = 6b367d0b59e5ef883734a896edbb2623 MD5 (patch-ab) = 488f351bda45b411c260bd3d8ee7f6f9 @@ -6,3 +6,4 @@ MD5 (patch-ac) = 3168a2b696288eaf9feb148eb5fb7831 MD5 (patch-ad) = fa20c139b28094d4b7a848f16ffcb9e3 MD5 (patch-ae) = 1178c5d7cd28a8230df4bffe33dd99a7 MD5 (patch-af) = 9115d1218ee47e59b7dc68dd09fef71f +MD5 (patch-ag) = dc79d66683986442e288cb93b779f1ab diff --git a/sysutils/amanda-client/patches/patch-ag b/sysutils/amanda-client/patches/patch-ag new file mode 100644 index 00000000000..3935707aaa3 --- /dev/null +++ b/sysutils/amanda-client/patches/patch-ag @@ -0,0 +1,163 @@ +--- changer-src/scsi-chio.c.orig Wed Jul 8 00:04:04 1998 ++++ changer-src/scsi-chio.c Mon Mar 6 15:26:26 2000 +@@ -119,25 +119,41 @@ + */ + int isempty(int fd, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_ST; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_nslots); +- + rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif ++ + if (rc) { + fprintf(stderr,"%s: changer status query failed: 0x%x %s\n", + get_pname(), rc,strerror(errno)); + return -1; + } + ++#if defined(OCHIOGSTATUS) ++ i = cesr.cesr_data[slot] & CESTATUS_FULL; ++ free(cesr.cesr_data); ++#else + i = ces.ces_data[slot] & CESTATUS_FULL; +- + free(ces.ces_data); ++#endif ++ + return !i; + } + +@@ -146,16 +162,27 @@ + */ + int find_empty(int fd) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_ST; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif + +- rc = ioctl(fd,CHIOGSTATUS,&ces); + if (rc) { + fprintf(stderr,"%s: changer status query failed: 0x%x %s\n", + get_pname(), rc, strerror(errno)); +@@ -163,9 +190,17 @@ + } + + i = 0; ++ ++#if defined(OCHIOGSTATUS) ++ while ((i < changer_info.cp_nslots)&&(cesr.cesr_data[i] & CESTATUS_FULL)) ++ i++; ++ free(cesr.cesr_data); ++#else + while ((i < changer_info.cp_nslots)&&(ces.ces_data[i] & CESTATUS_FULL)) + i++; + free(ces.ces_data); ++#endif ++ + return i; + } + +@@ -174,25 +209,41 @@ + */ + int drive_loaded(int fd, int drivenum) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_DT; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_ndrives); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_ndrives); +- + rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif ++ + if (rc) { + fprintf(stderr,"%s: drive status query failed: 0x%x %s\n", + get_pname(), rc, strerror(errno)); + return -1; + } + ++#if defined(OCHIOGSTATUS) ++ i = (cesr.cesr_data[drivenum] & CESTATUS_FULL); ++ free(cesr.cesr_data); ++#else + i = (ces.ces_data[drivenum] & CESTATUS_FULL); +- + free(ces.ces_data); ++#endif ++ + return i; + } + +@@ -202,7 +253,12 @@ + */ + int unload(int fd, int drive, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct changer_move_request move; ++#else + struct changer_move move; ++#endif ++ + int rc; + + move.cm_fromtype = CHET_DT; +@@ -226,7 +282,12 @@ + */ + int load(int fd, int drive, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct changer_move_request move; ++#else + struct changer_move move; ++#endif ++ + int rc; + + move.cm_fromtype = CHET_ST; diff --git a/sysutils/amanda-common/files/patch-sum b/sysutils/amanda-common/files/patch-sum index 656233a7e49..e936594dc17 100644 --- a/sysutils/amanda-common/files/patch-sum +++ b/sysutils/amanda-common/files/patch-sum @@ -1,6 +1,7 @@ -$NetBSD: patch-sum,v 1.2 1999/11/12 16:07:32 rh Exp $ +$NetBSD: patch-sum,v 1.3 2000/03/06 21:14:50 groo Exp $ MD5 (patch-aa) = a5cf361996d2c2c815fb9c11079d775b MD5 (patch-ab) = 2eaacdc2ccf0db3fe126cbc88eb36d26 MD5 (patch-ac) = 2dcc4ba64e249c61c0a303f10303683a MD5 (patch-ad) = 5d6a750fa5d7d1d26483b52790f82f0e +MD5 (patch-ae) = dc79d66683986442e288cb93b779f1ab diff --git a/sysutils/amanda-common/patches/patch-ae b/sysutils/amanda-common/patches/patch-ae new file mode 100644 index 00000000000..3935707aaa3 --- /dev/null +++ b/sysutils/amanda-common/patches/patch-ae @@ -0,0 +1,163 @@ +--- changer-src/scsi-chio.c.orig Wed Jul 8 00:04:04 1998 ++++ changer-src/scsi-chio.c Mon Mar 6 15:26:26 2000 +@@ -119,25 +119,41 @@ + */ + int isempty(int fd, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_ST; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_nslots); +- + rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif ++ + if (rc) { + fprintf(stderr,"%s: changer status query failed: 0x%x %s\n", + get_pname(), rc,strerror(errno)); + return -1; + } + ++#if defined(OCHIOGSTATUS) ++ i = cesr.cesr_data[slot] & CESTATUS_FULL; ++ free(cesr.cesr_data); ++#else + i = ces.ces_data[slot] & CESTATUS_FULL; +- + free(ces.ces_data); ++#endif ++ + return !i; + } + +@@ -146,16 +162,27 @@ + */ + int find_empty(int fd) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_ST; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif + +- rc = ioctl(fd,CHIOGSTATUS,&ces); + if (rc) { + fprintf(stderr,"%s: changer status query failed: 0x%x %s\n", + get_pname(), rc, strerror(errno)); +@@ -163,9 +190,17 @@ + } + + i = 0; ++ ++#if defined(OCHIOGSTATUS) ++ while ((i < changer_info.cp_nslots)&&(cesr.cesr_data[i] & CESTATUS_FULL)) ++ i++; ++ free(cesr.cesr_data); ++#else + while ((i < changer_info.cp_nslots)&&(ces.ces_data[i] & CESTATUS_FULL)) + i++; + free(ces.ces_data); ++#endif ++ + return i; + } + +@@ -174,25 +209,41 @@ + */ + int drive_loaded(int fd, int drivenum) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_DT; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_ndrives); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_ndrives); +- + rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif ++ + if (rc) { + fprintf(stderr,"%s: drive status query failed: 0x%x %s\n", + get_pname(), rc, strerror(errno)); + return -1; + } + ++#if defined(OCHIOGSTATUS) ++ i = (cesr.cesr_data[drivenum] & CESTATUS_FULL); ++ free(cesr.cesr_data); ++#else + i = (ces.ces_data[drivenum] & CESTATUS_FULL); +- + free(ces.ces_data); ++#endif ++ + return i; + } + +@@ -202,7 +253,12 @@ + */ + int unload(int fd, int drive, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct changer_move_request move; ++#else + struct changer_move move; ++#endif ++ + int rc; + + move.cm_fromtype = CHET_DT; +@@ -226,7 +282,12 @@ + */ + int load(int fd, int drive, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct changer_move_request move; ++#else + struct changer_move move; ++#endif ++ + int rc; + + move.cm_fromtype = CHET_ST; diff --git a/sysutils/amanda-server/files/patch-sum b/sysutils/amanda-server/files/patch-sum index 21da430d520..c15995a4245 100644 --- a/sysutils/amanda-server/files/patch-sum +++ b/sysutils/amanda-server/files/patch-sum @@ -1,4 +1,4 @@ -$NetBSD: patch-sum,v 1.3 1999/09/06 18:17:05 bad Exp $ +$NetBSD: patch-sum,v 1.4 2000/03/06 21:14:52 groo Exp $ MD5 (patch-aa) = 4f057e8227b12059dc4b75fefdb3385a MD5 (patch-ab) = 683940c28441b1bf5e51101c70ef6020 @@ -8,3 +8,4 @@ MD5 (patch-ae) = 94337bb089dad64045eebd2ae50e8a60 MD5 (patch-af) = ad691c5f446498750a993e2857e57132 MD5 (patch-ag) = b7df4171bf9a4daa9e7e4bd024857b10 MD5 (patch-ah) = 0abf39e69917329b3103e28fb7d47632 +MD5 (patch-ai) = dc79d66683986442e288cb93b779f1ab diff --git a/sysutils/amanda-server/patches/patch-ai b/sysutils/amanda-server/patches/patch-ai new file mode 100644 index 00000000000..3935707aaa3 --- /dev/null +++ b/sysutils/amanda-server/patches/patch-ai @@ -0,0 +1,163 @@ +--- changer-src/scsi-chio.c.orig Wed Jul 8 00:04:04 1998 ++++ changer-src/scsi-chio.c Mon Mar 6 15:26:26 2000 +@@ -119,25 +119,41 @@ + */ + int isempty(int fd, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_ST; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_nslots); +- + rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif ++ + if (rc) { + fprintf(stderr,"%s: changer status query failed: 0x%x %s\n", + get_pname(), rc,strerror(errno)); + return -1; + } + ++#if defined(OCHIOGSTATUS) ++ i = cesr.cesr_data[slot] & CESTATUS_FULL; ++ free(cesr.cesr_data); ++#else + i = ces.ces_data[slot] & CESTATUS_FULL; +- + free(ces.ces_data); ++#endif ++ + return !i; + } + +@@ -146,16 +162,27 @@ + */ + int find_empty(int fd) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_ST; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_nslots); ++ rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif + +- rc = ioctl(fd,CHIOGSTATUS,&ces); + if (rc) { + fprintf(stderr,"%s: changer status query failed: 0x%x %s\n", + get_pname(), rc, strerror(errno)); +@@ -163,9 +190,17 @@ + } + + i = 0; ++ ++#if defined(OCHIOGSTATUS) ++ while ((i < changer_info.cp_nslots)&&(cesr.cesr_data[i] & CESTATUS_FULL)) ++ i++; ++ free(cesr.cesr_data); ++#else + while ((i < changer_info.cp_nslots)&&(ces.ces_data[i] & CESTATUS_FULL)) + i++; + free(ces.ces_data); ++#endif ++ + return i; + } + +@@ -174,25 +209,41 @@ + */ + int drive_loaded(int fd, int drivenum) + { ++#if defined(OCHIOGSTATUS) ++struct ochanger_element_status_request cesr; ++#else + struct changer_element_status ces; ++#endif ++ + int i,rc; + int type=CHET_DT; + + get_changer_info(fd); + ++#if defined(OCHIOGSTATUS) ++ cesr.cesr_type = type; ++ cesr.cesr_data = malloc(changer_info.cp_ndrives); ++ rc = ioctl(fd, OCHIOGSTATUS, &cesr); ++#else + ces.ces_type = type; + ces.ces_data = malloc(changer_info.cp_ndrives); +- + rc = ioctl(fd, CHIOGSTATUS, &ces); ++#endif ++ + if (rc) { + fprintf(stderr,"%s: drive status query failed: 0x%x %s\n", + get_pname(), rc, strerror(errno)); + return -1; + } + ++#if defined(OCHIOGSTATUS) ++ i = (cesr.cesr_data[drivenum] & CESTATUS_FULL); ++ free(cesr.cesr_data); ++#else + i = (ces.ces_data[drivenum] & CESTATUS_FULL); +- + free(ces.ces_data); ++#endif ++ + return i; + } + +@@ -202,7 +253,12 @@ + */ + int unload(int fd, int drive, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct changer_move_request move; ++#else + struct changer_move move; ++#endif ++ + int rc; + + move.cm_fromtype = CHET_DT; +@@ -226,7 +282,12 @@ + */ + int load(int fd, int drive, int slot) + { ++#if defined(OCHIOGSTATUS) ++struct changer_move_request move; ++#else + struct changer_move move; ++#endif ++ + int rc; + + move.cm_fromtype = CHET_ST; |