Fixed FTBFS on GNU/kFreeBSD
a
|
b
|
struct freebsd_dev_channel *devicetable[
|
79 | 79 | // forward declaration |
80 | 80 | // static int parse_ata_chan_dev(const char * dev_name, struct freebsd_dev_channel *ch); |
81 | 81 | |
| 82 | #ifdef __GLIBC__ |
| 83 | static inline void * reallocf(void *ptr, size_t size) { |
| 84 | void *rv = realloc(ptr, size); |
| 85 | if(rv == NULL) |
| 86 | free(ptr); |
| 87 | return rv; |
| 88 | } |
| 89 | #endif |
82 | 90 | |
83 | 91 | // Returns 1 if device not available/open/found else 0. Also shifts fd into valid range. |
84 | 92 | static int isnotopen(int *fd, struct freebsd_dev_channel** fdchan) { |
… |
… |
int freebsd_ata_device::ata_command_inte
|
759 | 767 | #endif |
760 | 768 | return -1; |
761 | 769 | |
762 | | #if __FreeBSD_version < 502000 |
| 770 | #if (__FreeBSD_version < 502000) && (__FreeBSD_kernel_version < 502000) |
763 | 771 | printwarning(NO_RETURN,NULL); |
764 | 772 | #endif |
765 | 773 | |
… |
… |
int do_normal_scsi_cmnd_io(int fd, struc
|
1369 | 1377 | |
1370 | 1378 | if (cam_send_ccb(cam_dev,ccb) < 0) { |
1371 | 1379 | warn("error sending SCSI ccb"); |
1372 | | #if __FreeBSD_version > 500000 |
| 1380 | #if (__FreeBSD_version > 500000) || (__FreeBSD_kernel_version > 500000) |
1373 | 1381 | cam_error_print(cam_dev,ccb,CAM_ESF_ALL,CAM_EPF_ALL,stderr); |
1374 | 1382 | #endif |
1375 | 1383 | cam_freeccb(ccb); |
… |
… |
int do_normal_scsi_cmnd_io(int fd, struc
|
1377 | 1385 | } |
1378 | 1386 | |
1379 | 1387 | if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { |
1380 | | #if __FreeBSD_version > 500000 |
| 1388 | #if (__FreeBSD_version > 500000) || (__FreeBSD_kernel_version > 500000) |
1381 | 1389 | cam_error_print(cam_dev,ccb,CAM_ESF_ALL,CAM_EPF_ALL,stderr); |
1382 | 1390 | #endif |
1383 | 1391 | cam_freeccb(ccb); |