Skip to content

Commit

Permalink
session server REFACTOR unused func and vars
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Mar 13, 2024
1 parent 4ae31c9 commit 29f2f02
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/session_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,15 @@ nc_server_init_cb_ctx(const struct ly_ctx *ctx)
API int
nc_server_init(void)
{
pthread_rwlockattr_t attr, *attr_p = NULL;
pthread_rwlockattr_t *attr_p = NULL;
int r;

ATOMIC_STORE_RELAXED(server_opts.new_session_id, 1);
ATOMIC_STORE_RELAXED(server_opts.new_client_id, 1);

#ifdef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP
pthread_rwlockattr_t attr;

if ((r = pthread_rwlockattr_init(&attr))) {
ERR(NULL, "%s: failed init attribute (%s).", __func__, strerror(r));
goto error;
Expand Down Expand Up @@ -2023,6 +2025,8 @@ nc_server_set_address_port(struct nc_endpt *endpt, struct nc_bind *bind, const c
return ret;
}

#if defined (SO_PEERCRED) || defined (HAVE_GETPEEREID)

/**
* @brief Get UID of the owner of a socket.
*
Expand Down Expand Up @@ -2056,6 +2060,8 @@ nc_get_uid(int sock, uid_t *uid)
return 0;
}

#endif

static int
nc_accept_unix(struct nc_session *session, int sock)
{
Expand Down Expand Up @@ -2093,6 +2099,9 @@ nc_accept_unix(struct nc_session *session, int sock)

return 1;
#else
(void)session;
(void)sock;

return -1;
#endif
}
Expand Down

0 comments on commit 29f2f02

Please sign in to comment.