Skip to content

Commit 29f2f02

Browse files
committed
session server REFACTOR unused func and vars
1 parent 4ae31c9 commit 29f2f02

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/session_server.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,13 +787,15 @@ nc_server_init_cb_ctx(const struct ly_ctx *ctx)
787787
API int
788788
nc_server_init(void)
789789
{
790-
pthread_rwlockattr_t attr, *attr_p = NULL;
790+
pthread_rwlockattr_t *attr_p = NULL;
791791
int r;
792792

793793
ATOMIC_STORE_RELAXED(server_opts.new_session_id, 1);
794794
ATOMIC_STORE_RELAXED(server_opts.new_client_id, 1);
795795

796796
#ifdef HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP
797+
pthread_rwlockattr_t attr;
798+
797799
if ((r = pthread_rwlockattr_init(&attr))) {
798800
ERR(NULL, "%s: failed init attribute (%s).", __func__, strerror(r));
799801
goto error;
@@ -2023,6 +2025,8 @@ nc_server_set_address_port(struct nc_endpt *endpt, struct nc_bind *bind, const c
20232025
return ret;
20242026
}
20252027

2028+
#if defined (SO_PEERCRED) || defined (HAVE_GETPEEREID)
2029+
20262030
/**
20272031
* @brief Get UID of the owner of a socket.
20282032
*
@@ -2056,6 +2060,8 @@ nc_get_uid(int sock, uid_t *uid)
20562060
return 0;
20572061
}
20582062

2063+
#endif
2064+
20592065
static int
20602066
nc_accept_unix(struct nc_session *session, int sock)
20612067
{
@@ -2093,6 +2099,9 @@ nc_accept_unix(struct nc_session *session, int sock)
20932099

20942100
return 1;
20952101
#else
2102+
(void)session;
2103+
(void)sock;
2104+
20962105
return -1;
20972106
#endif
20982107
}

0 commit comments

Comments
 (0)