MCPcopy Create free account
hub / github.com/F-Stack/f-stack / LibAliasRefreshModules

Function LibAliasRefreshModules

freebsd/netinet/libalias/alias.c:1661–1691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659#ifndef _KERNEL
1660
1661int
1662LibAliasRefreshModules(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
1693int
1694LibAliasLoadModule(char *path)

Callers 1

LibAliasInitFunction · 0.85

Calls 3

LibAliasUnLoadAllModuleFunction · 0.85
isspaceFunction · 0.85
LibAliasLoadModuleFunction · 0.85

Tested by

no test coverage detected