| 1659 | #ifndef _KERNEL |
| 1660 | |
| 1661 | int |
| 1662 | LibAliasRefreshModules(void) |
| 1663 | { |
| 1664 | char buf[256], conf[] = "/etc/libalias.conf"; |
| 1665 | FILE *fd; |
| 1666 | int i, len; |
| 1667 | |
| 1668 | fd = fopen(conf, "r"); |
| 1669 | if (fd == NULL) |
| 1670 | err(1, "fopen(%s)", conf); |
| 1671 | |
| 1672 | LibAliasUnLoadAllModule(); |
| 1673 | |
| 1674 | for (;;) { |
| 1675 | fgets(buf, 256, fd); |
| 1676 | if (feof(fd)) |
| 1677 | break; |
| 1678 | len = strlen(buf); |
| 1679 | if (len > 1) { |
| 1680 | for (i = 0; i < len; i++) |
| 1681 | if (!isspace(buf[i])) |
| 1682 | break; |
| 1683 | if (buf[i] == '#') |
| 1684 | continue; |
| 1685 | buf[len - 1] = '\0'; |
| 1686 | LibAliasLoadModule(buf); |
| 1687 | } |
| 1688 | } |
| 1689 | fclose(fd); |
| 1690 | return (0); |
| 1691 | } |
| 1692 | |
| 1693 | int |
| 1694 | LibAliasLoadModule(char *path) |
no test coverage detected