src/stored/tape_dev.c
bool load_dev(DEVICE *dev)
{
#ifdef MTLOAD
   struct mtop mt_com;
#endif

   if (dev->fd() < 0) {
      dev->dev_errno = EBADF;
      Mmsg0(dev->errmsg, _("Bad call to load_dev. Device not open\n"));
      Emsg0(M_FATAL, 0, dev->errmsg);
      return false;
   }
   if (!(dev->is_tape())) {
      return true;
   }
#ifndef MTLOAD
   Dmsg0(200, "stored: MTLOAD command not available\n");
   berrno be;
   dev->dev_errno = ENOTTY;           /* function not available */
   Mmsg2(dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
         dev->print_name(), be.bstrerror());
   return false;
#else

   dev->block_num = dev->file = 0;
   dev->file_size = 0;
   dev->file_addr = 0;
   mt_com.mt_op = MTLOAD;
   mt_com.mt_count = 1;
   if (dev->d_ioctl(dev->fd(), MTIOCTOP, (char *)&mt_com) < 0) {
      berrno be;
      dev->dev_errno = errno;
      Mmsg2(dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
         dev->print_name(), be.bstrerror());
      return false;
   }
   return true;
#endif
}
/*
 * Load medium in device
 *  Returns: true  on success
 *           false on failure
 */
Load medium in device
Returns: true  on success
false on failure
Load medium in device Returns : true on success false on failure
bool load_dev(DEVICE *dev)
{
#ifdef MTLOAD
   struct mtop mt_com;
#endif
   if (dev->fd() < 0) {
      dev->dev_errno = EBADF;
      Mmsg0(dev->errmsg, _("Bad call to load_dev. Device not open\n"));
      Emsg0(M_FATAL, 0, dev->errmsg);
      return false;
   }
   if (!(dev->is_tape())) {
      return true;
   }
#ifndef MTLOAD
   Dmsg0(200, "stored: MTLOAD command not available\n");
   berrno be;
   dev->dev_errno = ENOTTY;           
   Mmsg2(dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
         dev->print_name(), be.bstrerror());
   return false;
#else
   dev->block_num = dev->file = 0;
   dev->file_size = 0;
   dev->file_addr = 0;
   mt_com.mt_op = MTLOAD;
   mt_com.mt_count = 1;
   if (dev->d_ioctl(dev->fd(), MTIOCTOP, (char *)&mt_com) < 0) {
      berrno be;
      dev->dev_errno = errno;
      Mmsg2(dev->errmsg, _("ioctl MTLOAD error on %s. ERR=%s.\n"),
         dev->print_name(), be.bstrerror());
      return false;
   }
   return true;
#endif
}
bool load_dev ( DEVICE * dev ) { #ifdef MTLOAD struct mtop mt_com ; #endif if ( dev -> fd ( ) < 0 ) { dev -> dev_errno = EBADF ; Mmsg0 ( dev -> errmsg , _ ( " \n " ) ) ; Emsg0 ( M_FATAL , 0 , dev -> errmsg ) ; return false ; } if ( ! ( dev -> is_tape ( ) ) ) { return true ; } #ifndef MTLOAD Dmsg0 ( 200 , " \n " ) ; berrno be ; dev -> dev_errno = ENOTTY ; Mmsg2 ( dev -> errmsg , _ ( " \n " ) , dev -> print_name ( ) , be . bstrerror ( ) ) ; return false ; #else dev -> block_num = dev -> file = 0 ; dev -> file_size = 0 ; dev -> file_addr = 0 ; mt_com . mt_op = MTLOAD ; mt_com . mt_count = 1 ; if ( dev -> d_ioctl ( dev -> fd ( ) , MTIOCTOP , ( char * ) & mt_com ) < 0 ) { berrno be ; dev -> dev_errno = errno ; Mmsg2 ( dev -> errmsg , _ ( " \n " ) , dev -> print_name ( ) , be . bstrerror ( ) ) ; return false ; } return true ; #endif }
Load medium in device
  Returns: true  on success
           false on failure
Load medium in device Returns : true on success false on failure
/* function not available */