| 510 | } |
| 511 | |
| 512 | void dfs_devfs_device_add(rt_device_t device) |
| 513 | { |
| 514 | int fd; |
| 515 | char path[512]; |
| 516 | |
| 517 | if (device) |
| 518 | { |
| 519 | rt_snprintf(path, 512, "/dev/%s", device->parent.name); |
| 520 | |
| 521 | if (access(path, 0) != 0) |
| 522 | { |
| 523 | mode_t mode = dfs_devfs_device_to_mode(device); |
| 524 | |
| 525 | dfs_devfs_mkdir(path, mode); |
| 526 | |
| 527 | fd = open(path, O_RDWR | O_CREAT, mode); |
| 528 | if (fd >= 0) |
| 529 | { |
| 530 | close(fd); |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | int dfs_devfs_update(void) |
| 537 | { |
no test coverage detected