Ticket #10: 65_freebsd.patch

File 65_freebsd.patch, 1.8 KB (added by Giuseppe Iuculano, 11 years ago)

Fix FTBFS on GNU/kFreeBSD

  • os_freebsd.cpp

    Fixed FTBFS on GNU/kFreeBSD
    a b struct freebsd_dev_channel *devicetable[ 
    7979// forward declaration
    8080// static int parse_ata_chan_dev(const char * dev_name, struct freebsd_dev_channel *ch);
    8181
     82#ifdef __GLIBC__
     83static 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
    8290
    8391// Returns 1 if device not available/open/found else 0.  Also shifts fd into valid range.
    8492static int isnotopen(int *fd, struct freebsd_dev_channel** fdchan) {
    int freebsd_ata_device::ata_command_inte 
    759767                        #endif
    760768                return -1;
    761769               
    762                 #if __FreeBSD_version < 502000
     770                #if (__FreeBSD_version < 502000) && (__FreeBSD_kernel_version < 502000)
    763771                printwarning(NO_RETURN,NULL);
    764772                #endif
    765773               
    int do_normal_scsi_cmnd_io(int fd, struc 
    13691377
    13701378  if (cam_send_ccb(cam_dev,ccb) < 0) {
    13711379    warn("error sending SCSI ccb");
    1372  #if __FreeBSD_version > 500000
     1380 #if (__FreeBSD_version > 500000) || (__FreeBSD_kernel_version > 500000)
    13731381    cam_error_print(cam_dev,ccb,CAM_ESF_ALL,CAM_EPF_ALL,stderr);
    13741382 #endif
    13751383    cam_freeccb(ccb);
    int do_normal_scsi_cmnd_io(int fd, struc 
    13771385  }
    13781386
    13791387  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)
    13811389    cam_error_print(cam_dev,ccb,CAM_ESF_ALL,CAM_EPF_ALL,stderr);
    13821390 #endif
    13831391    cam_freeccb(ccb);
  • cciss.cpp

    a b  
    1919#  include <sys/endian.h>
    2020#  include <dev/ciss/cissio.h>
    2121#  define _HAVE_CCISS
     22#elif defined(__FreeBSD_kernel__) && defined(HAVE_DEV_CISS_CISSIO_H)
     23#  include <endian.h>
     24#  include <dev/ciss/cissio.h>
     25#  define _HAVE_CCISS
    2226#endif
    2327
    2428#ifdef _HAVE_CCISS