本文整理汇总了C++中DEVICE::is_fifo方法的典型用法代码示例。如果您正苦于以下问题:C++ DEVICE::is_fifo方法的具体用法?C++ DEVICE::is_fifo怎么用?C++ DEVICE::is_fifo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DEVICE
的用法示例。
在下文中一共展示了DEVICE::is_fifo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
dev->min_block_size = device->min_block_size;
dev->max_block_size = device->max_block_size;
dev->max_volume_size = device->max_volume_size;
dev->max_file_size = device->max_file_size;
dev->max_concurrent_jobs = device->max_concurrent_jobs;
dev->volume_capacity = device->volume_capacity;
dev->max_rewind_wait = device->max_rewind_wait;
dev->max_open_wait = device->max_open_wait;
dev->vol_poll_interval = device->vol_poll_interval;
dev->max_spool_size = device->max_spool_size;
dev->drive_index = device->drive_index;
dev->enabled = device->enabled;
dev->autoselect = device->autoselect;
dev->read_only = device->read_only;
dev->dev_type = device->dev_type;
dev->device = device;
if (dev->is_tape()) { /* No parts on tapes */
dev->max_part_size = 0;
} else {
dev->max_part_size = device->max_part_size;
}
/* Sanity check */
if (dev->vol_poll_interval && dev->vol_poll_interval < 60) {
dev->vol_poll_interval = 60;
}
if (!device->dev) {
/* The first time we create a DEVICE from the DEVRES, we keep a pointer
* to the DEVICE accessible from the DEVRES.
*/
device->dev = dev;
}
if (dev->is_fifo()) {
dev->capabilities |= CAP_STREAM; /* set stream device */
}
/* If the device requires mount :
* - Check that the mount point is available
* - Check that (un)mount commands are defined
*/
if (dev->is_file() && dev->requires_mount()) {
if (!device->mount_point || stat(device->mount_point, &statp) < 0) {
berrno be;
dev->dev_errno = errno;
Jmsg2(jcr, M_ERROR_TERM, 0, _("Unable to stat mount point %s: ERR=%s\n"),
device->mount_point, be.bstrerror());
}
if (!device->mount_command || !device->unmount_command) {
Jmsg0(jcr, M_ERROR_TERM, 0, _("Mount and unmount commands must defined for a device which requires mount.\n"));
}
}
/* Keep the device ID in the DEVICE struct to identify the hardware */
if (dev->is_file() && stat(dev->archive_name(), &statp) == 0) {
dev->devno = statp.st_dev;
}
/* Sanity check */
if (dev->max_block_size == 0) {
max_bs = DEFAULT_BLOCK_SIZE;
} else {
max_bs = dev->max_block_size;
}
if (dev->min_block_size > max_bs) {
示例2: if
//.........这里部分代码省略.........
Mmsg(dev->prt_name, "\"%s\" (%s)", device->name(), device->device_name);
Dmsg1(400, "Allocate dev=%s\n", dev->print_name());
copy_bits(CAP_MAX, device->cap_bits, dev->capabilities);
/*
* current block sizes
*/
dev->min_block_size = device->min_block_size;
dev->max_block_size = device->max_block_size;
dev->max_volume_size = device->max_volume_size;
dev->max_file_size = device->max_file_size;
dev->max_concurrent_jobs = device->max_concurrent_jobs;
dev->volume_capacity = device->volume_capacity;
dev->max_rewind_wait = device->max_rewind_wait;
dev->max_open_wait = device->max_open_wait;
dev->max_open_vols = device->max_open_vols;
dev->vol_poll_interval = device->vol_poll_interval;
dev->max_spool_size = device->max_spool_size;
dev->drive = device->drive;
dev->drive_index = device->drive_index;
dev->autoselect = device->autoselect;
dev->norewindonclose = device->norewindonclose;
dev->dev_type = device->dev_type;
dev->device = device;
/*
* Sanity check
*/
if (dev->vol_poll_interval && dev->vol_poll_interval < 60) {
dev->vol_poll_interval = 60;
}
device->dev = dev;
if (dev->is_fifo()) {
dev->set_cap(CAP_STREAM); /* set stream device */
}
/*
* If the device requires mount :
* - Check that the mount point is available
* - Check that (un)mount commands are defined
*/
if (dev->is_file() && dev->requires_mount()) {
if (!device->mount_point || stat(device->mount_point, &statp) < 0) {
berrno be;
dev->dev_errno = errno;
Jmsg2(jcr, M_ERROR_TERM, 0, _("Unable to stat mount point %s: ERR=%s\n"),
device->mount_point, be.bstrerror());
}
if (!device->mount_command || !device->unmount_command) {
Jmsg0(jcr, M_ERROR_TERM, 0, _("Mount and unmount commands must defined for a device which requires mount.\n"));
}
}
/*
* Sanity check
*/
if (dev->max_block_size == 0) {
max_bs = DEFAULT_BLOCK_SIZE;
} else {
max_bs = dev->max_block_size;
}
if (dev->min_block_size > max_bs) {
Jmsg(jcr, M_ERROR_TERM, 0, _("Min block size > max on device %s\n"), dev->print_name());
}