Skip to content

Commit

Permalink
zebra: Add some documentation on when zserv_open should be used
Browse files Browse the repository at this point in the history
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
  • Loading branch information
donaldsharp committed Jan 17, 2025
1 parent 283cc51 commit 4b96752
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zebra/zserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,10 @@ void zserv_close(void)
/*
* Open zebra's ZAPI listener socket. This is done early during startup,
* before zebra is ready to listen and accept client connections.
*
* This function should only ever be called from the startup pthread
* from main.c. If it is called multiple times it will cause problems
* because it causes the zsock global variable to be setup.
*/
void zserv_open(const char *path)
{
Expand Down
3 changes: 3 additions & 0 deletions zebra/zserv.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ extern void zserv_close(void);
*
* path
* where to place the Unix domain socket
*
* This function *should* only ever be called from
* main() and only every from 1 pthread.
*/
extern void zserv_open(const char *path);

Expand Down

0 comments on commit 4b96752

Please sign in to comment.