Lines Matching refs:fd
382 int fd = open(drive.Path(), O_RDWR);
383 if (fd < 0)
387 if (read(fd, &oldMBR, sizeof(oldMBR)) != sizeof(oldMBR)) {
388 close(fd);
393 close(fd);
400 close(fd);
451 close(fd);
455 lseek(fd, 0, SEEK_SET);
457 status_t status = _WriteBlocks(fd, buffer, newBootLoader.Position());
458 close(fd);
471 int fd = open(path.String(), O_RDONLY);
472 if (fd < 0)
478 close(fd);
482 status_t status = _ReadBlocks(fd, buffer, size);
484 close(fd);
491 close(fd);
499 close(fd);
511 int fd = open(path.String(), O_RDWR);
512 if (fd < 0)
516 if (read(fd, &oldMBR, sizeof(oldMBR)) != sizeof(oldMBR)) {
517 close(fd);
521 close(fd);
525 lseek(fd, 0, SEEK_SET);
530 close(fd);
535 close(fd);
542 close(fd);
549 status_t status = _WriteBlocks(fd, buffer, size);
551 close(fd);
613 int fd = open(device, O_RDONLY);
614 if (fd < 0)
617 status_t status = ioctl(fd, B_GET_BIOS_DRIVE_ID, &drive, 1);
618 close(fd);
624 LegacyBootMenu::_ReadBlocks(int fd, uint8* buffer, size_t size)
634 if (read(fd, block, kBlockSize) != (ssize_t)kBlockSize)
642 LegacyBootMenu::_WriteBlocks(int fd, const uint8* buffer, size_t size)
652 if (write(fd, block, kBlockSize) != (ssize_t)kBlockSize)