* file named AUTHORS, in the root directory of this distribution.
*/
/*
- * $Id: scsi-hpux.c,v 1.4.4.9.6.1 2002/08/22 17:41:10 martinea Exp $
+ * $Id: scsi-hpux.c,v 1.15 2006/05/25 01:47:07 johnfranks Exp $
*
* scsi-chio.c -- library routines to handle the changer
* support for chio based systems
#include "amanda.h"
-#if defined(HAVE_HPUX_SCSI_CHIO)
# include <sys/scsi.h>
# include <sys/mtio.h> /* for eject_tape ioctls */
static int get_changer_info(fd)
{
-int rc = 0;
+ int rc = 0;
if (!changer_info_init) {
rc = ioctl(fd, SIOC_ELEMENT_ADDRESSES, &changer_info);
perror(dev);
return 0;
}
- memset(buffer, 0, sizeof(buffer));
+ memset(buffer, 0, SIZEOF(buffer));
*((int *) buffer) = 0; /* length of input data */
*(((int *) buffer) + 1) = 100; /* length of output buffer */
rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es);
if (rc) {
- fprintf(stderr, "%s: element status query failed: 0x%x %s\n",
+ g_fprintf(stderr, _("%s: element status query failed: 0x%x %s\n"),
get_pname(), rc, strerror(errno));
return(-1);
}
/*
* find the first empty slot
*/
-int find_empty(int fd)
+int find_empty(int fd, int start, int count)
{
struct element_status es;
int i, rc;
&& !rc && es.full);
if (rc) {
- fprintf(stderr,"%s: element status query failed: 0x%x %s\n",
+ g_fprintf(stderr,_("%s: element status query failed: 0x%x %s\n"),
get_pname(), rc, strerror(errno));
return -1;
}
rc = ioctl(fd, SIOC_ELEMENT_STATUS, &es);
if (rc) {
- fprintf(stderr,"%s: drive status quer failed: 0x%x %s\n",
+ g_fprintf(stderr,_("%s: drive status quer failed: 0x%x %s\n"),
get_pname(), rc, strerror(errno));
return(-1);
}
rc = ioctl(fd, SIOC_MOVE_MEDIUM, &move);
if (rc){
- fprintf(stderr,"%s: move medium command failed: 0x%x %s\n",
+ g_fprintf(stderr,_("%s: move medium command failed: 0x%x %s\n"),
get_pname(), rc, strerror(errno));
return(-2);
}
rc = ioctl(fd, SIOC_MOVE_MEDIUM,&move);
if (rc){
- fprintf(stderr,"%s: drive load failed (MOVE): 0x%x %s\n",
+ g_fprintf(stderr,_("%s: drive load failed (MOVE): 0x%x %s\n"),
get_pname(), rc, strerror(errno));
return(-2);
}
rc = get_changer_info(fd);
if (rc) {
- fprintf(stderr, "%s: storage size query failed: 0x%x %s\n", get_pname(),
+ g_fprintf(stderr, _("%s: storage size query failed: 0x%x %s\n"), get_pname(),
rc, strerror(errno));
return -1;
}
rc = get_changer_info(fd);
if (rc) {
- fprintf(stderr, "%s: drive count query failed: 0x%x %s\n", get_pname(),
+ g_fprintf(stderr, _("%s: drive count query failed: 0x%x %s\n"), get_pname(),
rc, strerror(errno));
return -1;
}
int DeviceFD;
DeviceFD = open(tapedev, O_RDWR);
+ dbprintf(_("OpenDevice(%s) returns %d\n"), tapedev, DeviceFD);
return(DeviceFD);
}
-int CloseDevice(int DeviceFD)
+int CloseDevice(char *device, int DeviceFD)
{
int ret;
ret = close(DeviceFD);
+ dbprintf(_("CloseDevice(%s) returns %d\n"), device, ret);
return(ret);
}
-
-#endif