diff options
Diffstat (limited to 'test/mocks/netconf-pnp-simulator/engine/patches/libnetconf2/03-fix-missing-pthread_rwlockattr_setkind_np.patch')
-rw-r--r-- | test/mocks/netconf-pnp-simulator/engine/patches/libnetconf2/03-fix-missing-pthread_rwlockattr_setkind_np.patch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/mocks/netconf-pnp-simulator/engine/patches/libnetconf2/03-fix-missing-pthread_rwlockattr_setkind_np.patch b/test/mocks/netconf-pnp-simulator/engine/patches/libnetconf2/03-fix-missing-pthread_rwlockattr_setkind_np.patch new file mode 100644 index 000000000..65537a017 --- /dev/null +++ b/test/mocks/netconf-pnp-simulator/engine/patches/libnetconf2/03-fix-missing-pthread_rwlockattr_setkind_np.patch @@ -0,0 +1,20 @@ +diff --git a/src/session_server.c b/src/session_server.c +index 636b1a2..57f2854 100644 +--- a/src/session_server.c ++++ b/src/session_server.c +@@ -560,6 +560,7 @@ nc_server_init(struct ly_ctx *ctx) + errno=0; + + if (pthread_rwlockattr_init(&attr) == 0) { ++#ifdef PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP + if (pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) == 0) { + if (pthread_rwlock_init(&server_opts.endpt_lock, &attr) != 0) { + ERR("%s: failed to init rwlock(%s).", __FUNCTION__, strerror(errno)); +@@ -570,6 +571,7 @@ nc_server_init(struct ly_ctx *ctx) + } else { + ERR("%s: failed set attribute (%s).", __FUNCTION__, strerror(errno)); + } ++#endif + pthread_rwlockattr_destroy(&attr); + } else { + ERR("%s: failed init attribute (%s).", __FUNCTION__, strerror(errno)); |