diff --git a/debian/patches/65_freebsd.patch b/debian/patches/65_freebsd.patch index 65c6582..d7f851b 100644 --- a/debian/patches/65_freebsd.patch +++ b/debian/patches/65_freebsd.patch @@ -1,7 +1,22 @@ Fixed FTBFS on GNU/kFreeBSD --- a/os_freebsd.cpp +++ b/os_freebsd.cpp -@@ -759,7 +759,7 @@ int freebsd_ata_device::ata_command_inte +@@ -79,6 +79,14 @@ struct freebsd_dev_channel *devicetable[ + // forward declaration + // static int parse_ata_chan_dev(const char * dev_name, struct freebsd_dev_channel *ch); + ++#ifdef __GLIBC__ ++static inline void * reallocf(void *ptr, size_t size) { ++ void *rv = realloc(ptr, size); ++ if(rv == NULL) ++ free(ptr); ++ return rv; ++ } ++#endif + + // Returns 1 if device not available/open/found else 0. Also shifts fd into valid range. + static int isnotopen(int *fd, struct freebsd_dev_channel** fdchan) { +@@ -759,7 +767,7 @@ int freebsd_ata_device::ata_command_inte #endif return -1; @@ -10,7 +25,7 @@ Fixed FTBFS on GNU/kFreeBSD printwarning(NO_RETURN,NULL); #endif -@@ -1369,7 +1369,7 @@ int do_normal_scsi_cmnd_io(int fd, struc +@@ -1369,7 +1377,7 @@ int do_normal_scsi_cmnd_io(int fd, struc if (cam_send_ccb(cam_dev,ccb) < 0) { warn("error sending SCSI ccb"); @@ -19,7 +34,7 @@ Fixed FTBFS on GNU/kFreeBSD cam_error_print(cam_dev,ccb,CAM_ESF_ALL,CAM_EPF_ALL,stderr); #endif cam_freeccb(ccb); -@@ -1377,7 +1377,7 @@ int do_normal_scsi_cmnd_io(int fd, struc +@@ -1377,7 +1385,7 @@ int do_normal_scsi_cmnd_io(int fd, struc } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -28,3 +43,16 @@ Fixed FTBFS on GNU/kFreeBSD cam_error_print(cam_dev,ccb,CAM_ESF_ALL,CAM_EPF_ALL,stderr); #endif cam_freeccb(ccb); +--- a/cciss.cpp ++++ b/cciss.cpp +@@ -19,6 +19,10 @@ + # include + # include + # define _HAVE_CCISS ++#elif defined(__FreeBSD_kernel__) && defined(HAVE_DEV_CISS_CISSIO_H) ++# include ++# include ++# define _HAVE_CCISS + #endif + + #ifdef _HAVE_CCISS