diff --git a/libburn/cleanup.c b/libburn/cleanup.c index 2ac2ccc..db370fc 100644 --- a/libburn/cleanup.c +++ b/libburn/cleanup.c @@ -29,7 +29,11 @@ static int signal_list[]= { SIGFPE, SIGSEGV, SIGPIPE, SIGALRM, SIGTERM, SIGUSR1, SIGUSR2, SIGXCPU, SIGTSTP, SIGTTIN, SIGTTOU, - SIGBUS, SIGPOLL, SIGPROF, SIGSYS, SIGTRAP, + SIGBUS, +#ifdef __Linux__ + SIGPOLL, +#endif + SIGPROF, SIGSYS, SIGTRAP, SIGVTALRM, SIGXCPU, SIGXFSZ, -1 }; static char *signal_name_list[]= { @@ -37,7 +41,11 @@ static char *signal_name_list[]= { "SIGFPE", "SIGSEGV", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGUSR1", "SIGUSR2", "SIGXCPU", "SIGTSTP", "SIGTTIN", "SIGTTOU", - "SIGBUS", "SIGPOLL", "SIGPROF", "SIGSYS", "SIGTRAP", + "SIGBUS", +#ifdef __Linux__ + "SIGPOLL", +#endif + "SIGPROF", "SIGSYS", "SIGTRAP", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "@" }; static int signal_list_count= 24; diff --git a/libburn/drive.c b/libburn/drive.c index dfec94e..f331947 100644 --- a/libburn/drive.c +++ b/libburn/drive.c @@ -2,7 +2,11 @@ #include #include +#ifdef __Linux__ #include +#else +#include +#endif #include #include @@ -61,11 +65,16 @@ void burn_drive_free_all(void) /* ts A60822 */ int burn_drive_is_open(struct burn_drive *d) { +#if defined(__Linux__) /* a bit more detailed case distinction than needed */ if (d->fd == -1337) return 0; if (d->fd < 0) return 0; +#elif defined(__FreeBSD__) + if (d->cam == NULL) + return 0; +#endif return 1; } @@ -456,7 +465,7 @@ static void strip_spaces(char *str) static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out) { - struct scsi_inquiry_data *id; + struct burn_scsi_inquiry_data *id; /* ts A61007 : now prevented in enumerate_common() */ #if 0 @@ -467,7 +476,7 @@ static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out) if (!d->idata->valid || !d->mdata->valid) return 0; - id = (struct scsi_inquiry_data *)d->idata; + id = (struct burn_scsi_inquiry_data *)d->idata; memcpy(out->vendor, id->vendor, sizeof(id->vendor)); strip_spaces(out->vendor); diff --git a/libburn/read.c b/libburn/read.c index 4f27207..a715809 100644 --- a/libburn/read.c +++ b/libburn/read.c @@ -1,6 +1,10 @@ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ +#ifdef __Linux__ #include +#else +#include +#endif #include #include diff --git a/libburn/sbc.c b/libburn/sbc.c index dcd64ae..48a01ec 100644 --- a/libburn/sbc.c +++ b/libburn/sbc.c @@ -2,9 +2,12 @@ /* scsi block commands */ +#ifdef __Linux__ +/* XXX Why do we need this here? */ #include -#include #include +#endif +#include #include "transport.h" #include "sbc.h" diff --git a/libburn/spc.c b/libburn/spc.c index 186eef7..d90ab60 100644 --- a/libburn/spc.c +++ b/libburn/spc.c @@ -75,7 +75,7 @@ int spc_get_erase_progress(struct burn_drive *d) void spc_inquiry(struct burn_drive *d) { struct buffer buf; - struct scsi_inquiry_data *id; + struct burn_scsi_inquiry_data *id; struct command c; memcpy(c.opcode, SPC_INQUIRY, sizeof(SPC_INQUIRY)); @@ -87,7 +87,7 @@ void spc_inquiry(struct burn_drive *d) c.dir = FROM_DRIVE; d->issue_command(d, &c); - id = (struct scsi_inquiry_data *)d->idata; + id = (struct burn_scsi_inquiry_data *)d->idata; id->vendor[8] = 0; id->product[16] = 0; id->revision[4] = 0; diff --git a/libburn/transport.h b/libburn/transport.h index 7b90317..6ed65ec 100644 --- a/libburn/transport.h +++ b/libburn/transport.h @@ -8,15 +8,18 @@ #include /* sg data structures */ #include +#ifdef __Linux__ +/* XXX Why do we need this here? */ #include #include +#endif /* kludge! glibc headers don't define all the SCSI shit that we use! */ #ifndef SG_GET_ACCESS_COUNT # define SG_GET_ACCESS_COUNT 0x2289 #endif -#define BUFFER_SIZE 65536 +#define BUFFER_SIZE 65536/2 enum transfer_direction { TO_DRIVE, FROM_DRIVE, NO_TRANSFER }; @@ -55,7 +58,7 @@ struct command struct buffer *page; }; -struct scsi_inquiry_data +struct burn_scsi_inquiry_data { char vendor[9]; char product[17]; @@ -101,7 +104,11 @@ struct burn_drive int channel; int lun; char *devname; +#if defined(__Linux__) int fd; +#elif defined(__FreeBSD__) + struct cam_device* cam; +#endif /* ts A60926 : trying to lock against growisofs /dev/srN, /dev/scdN */ int sibling_count; @@ -174,7 +181,7 @@ struct burn_drive int (*test_unit_ready) (struct burn_drive * d); void (*probe_write_modes) (struct burn_drive * d); struct params params; - struct scsi_inquiry_data *idata; + struct burn_scsi_inquiry_data *idata; struct scsi_mode_data *mdata; int toc_entries; struct burn_toc_entry *toc_entry;