summaryrefslogtreecommitdiff
path: root/src/s_serv.c
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-06 17:35:22 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-06 17:35:22 +0000
commit4f02df1fc30f68825daf01c446382effce2a4ea7 (patch)
treef74be8b8263b24f80dd6ed41f9d869d7f2188178 /src/s_serv.c
parent50ed41bcd9f0c7596f2b5449aecddae3c9e224c2 (diff)
- Added read_links_file()
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2215 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src/s_serv.c')
-rw-r--r--src/s_serv.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/s_serv.c b/src/s_serv.c
index dc457f8..3415ad4 100644
--- a/src/s_serv.c
+++ b/src/s_serv.c
@@ -76,7 +76,7 @@ void
write_links_file(void *notused)
{
FILE *file = NULL;
- dlink_node *ptr = NULL, *ptr_next = NULL;;
+ dlink_node *ptr = NULL, *ptr_next = NULL;
char buff[IRCD_BUFSIZE] = { '\0' };
if ((file = fopen(LIPATH, "w")) == NULL)
@@ -121,6 +121,27 @@ write_links_file(void *notused)
fclose(file);
}
+void
+read_links_file(void)
+{
+ FILE *file = NULL;
+ char *p = NULL;
+ char buff[IRCD_BUFSIZE] = { '\0' };
+
+ if ((file = fopen(LIPATH, "r")) == NULL)
+ return;
+
+ while (fgets(buff, sizeof(buff), file))
+ {
+ if ((p = strchr(buff, '\n')) != NULL)
+ *p = '\0';
+
+ dlinkAddTail(xstrdup(buff), make_dlink_node(), &flatten_links);
+ }
+
+ fclose(file);
+}
+
/* hunt_server()
* Do the basic thing in delivering the message (command)
* across the relays to the specific server (server) for