projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: don't use strerror() from ust lock nocheck
[lttng-ust.git]
/
src
/
lib
/
lttng-ust
/
lttng-ust-comm.c
diff --git
a/src/lib/lttng-ust/lttng-ust-comm.c
b/src/lib/lttng-ust/lttng-ust-comm.c
index b1c35480e88c10f2c316d245256f00f52838f829..384a6a582af8a2034c9678b31b400b4e33b95f50 100644
(file)
--- a/
src/lib/lttng-ust/lttng-ust-comm.c
+++ b/
src/lib/lttng-ust/lttng-ust-comm.c
@@
-1,7
+1,7
@@
/*
* SPDX-License-Identifier: LGPL-2.1-only
*
/*
* SPDX-License-Identifier: LGPL-2.1-only
*
- * Copyright (C) 2011
David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011
EfficiOS Inc.
* Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
* Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
@@
-38,6
+38,7
@@
#include <lttng/ust-thread.h>
#include <lttng/ust-tracer.h>
#include <lttng/ust-common.h>
#include <lttng/ust-thread.h>
#include <lttng/ust-tracer.h>
#include <lttng/ust-common.h>
+#include <lttng/ust-cancelstate.h>
#include <urcu/tls-compat.h>
#include "lib/lttng-ust/futex.h"
#include "common/ustcomm.h"
#include <urcu/tls-compat.h>
#include "lib/lttng-ust/futex.h"
#include "common/ustcomm.h"
@@
-125,25
+126,21
@@
int lttng_ust_loaded __attribute__((weak));
int ust_lock(void)
{
sigset_t sig_all_blocked, orig_mask;
int ust_lock(void)
{
sigset_t sig_all_blocked, orig_mask;
- int ret
, oldstate
;
+ int ret;
- ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
- if (ret) {
- ERR("pthread_setcancelstate: %s", strerror(ret));
- }
- if (oldstate != PTHREAD_CANCEL_ENABLE) {
- ERR("pthread_setcancelstate: unexpected oldstate");
+ if (lttng_ust_cancelstate_disable_push()) {
+ ERR("lttng_ust_cancelstate_disable_push");
}
sigfillset(&sig_all_blocked);
ret = pthread_sigmask(SIG_SETMASK, &sig_all_blocked, &orig_mask);
if (ret) {
}
sigfillset(&sig_all_blocked);
ret = pthread_sigmask(SIG_SETMASK, &sig_all_blocked, &orig_mask);
if (ret) {
- ERR("pthread_sigmask:
%s", strerror(ret)
);
+ ERR("pthread_sigmask:
ret=%d", ret
);
}
if (!URCU_TLS(ust_mutex_nest)++)
pthread_mutex_lock(&ust_mutex);
ret = pthread_sigmask(SIG_SETMASK, &orig_mask, NULL);
if (ret) {
}
if (!URCU_TLS(ust_mutex_nest)++)
pthread_mutex_lock(&ust_mutex);
ret = pthread_sigmask(SIG_SETMASK, &orig_mask, NULL);
if (ret) {
- ERR("pthread_sigmask:
%s", strerror(ret)
);
+ ERR("pthread_sigmask:
ret=%d", ret
);
}
if (lttng_ust_comm_should_quit) {
return -1;
}
if (lttng_ust_comm_should_quit) {
return -1;
@@
-161,25
+158,21
@@
int ust_lock(void)
void ust_lock_nocheck(void)
{
sigset_t sig_all_blocked, orig_mask;
void ust_lock_nocheck(void)
{
sigset_t sig_all_blocked, orig_mask;
- int ret
, oldstate
;
+ int ret;
- ret = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate);
- if (ret) {
- ERR("pthread_setcancelstate: %s", strerror(ret));
- }
- if (oldstate != PTHREAD_CANCEL_ENABLE) {
- ERR("pthread_setcancelstate: unexpected oldstate");
+ if (lttng_ust_cancelstate_disable_push()) {
+ ERR("lttng_ust_cancelstate_disable_push");
}
sigfillset(&sig_all_blocked);
ret = pthread_sigmask(SIG_SETMASK, &sig_all_blocked, &orig_mask);
if (ret) {
}
sigfillset(&sig_all_blocked);
ret = pthread_sigmask(SIG_SETMASK, &sig_all_blocked, &orig_mask);
if (ret) {
- ERR("pthread_sigmask:
%s", strerror(ret)
);
+ ERR("pthread_sigmask:
ret=%d", ret
);
}
if (!URCU_TLS(ust_mutex_nest)++)
pthread_mutex_lock(&ust_mutex);
ret = pthread_sigmask(SIG_SETMASK, &orig_mask, NULL);
if (ret) {
}
if (!URCU_TLS(ust_mutex_nest)++)
pthread_mutex_lock(&ust_mutex);
ret = pthread_sigmask(SIG_SETMASK, &orig_mask, NULL);
if (ret) {
- ERR("pthread_sigmask:
%s", strerror(ret)
);
+ ERR("pthread_sigmask:
ret=%d", ret
);
}
}
}
}
@@
-189,25
+182,21
@@
void ust_lock_nocheck(void)
void ust_unlock(void)
{
sigset_t sig_all_blocked, orig_mask;
void ust_unlock(void)
{
sigset_t sig_all_blocked, orig_mask;
- int ret
, oldstate
;
+ int ret;
sigfillset(&sig_all_blocked);
ret = pthread_sigmask(SIG_SETMASK, &sig_all_blocked, &orig_mask);
if (ret) {
sigfillset(&sig_all_blocked);
ret = pthread_sigmask(SIG_SETMASK, &sig_all_blocked, &orig_mask);
if (ret) {
- ERR("pthread_sigmask:
%s", strerror(ret)
);
+ ERR("pthread_sigmask:
ret=%d", ret
);
}
if (!--URCU_TLS(ust_mutex_nest))
pthread_mutex_unlock(&ust_mutex);
ret = pthread_sigmask(SIG_SETMASK, &orig_mask, NULL);
if (ret) {
}
if (!--URCU_TLS(ust_mutex_nest))
pthread_mutex_unlock(&ust_mutex);
ret = pthread_sigmask(SIG_SETMASK, &orig_mask, NULL);
if (ret) {
- ERR("pthread_sigmask:
%s", strerror(ret)
);
+ ERR("pthread_sigmask:
ret=%d", ret
);
}
}
- ret = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate);
- if (ret) {
- ERR("pthread_setcancelstate: %s", strerror(ret));
- }
- if (oldstate != PTHREAD_CANCEL_DISABLE) {
- ERR("pthread_setcancelstate: unexpected oldstate");
+ if (lttng_ust_cancelstate_disable_pop()) {
+ ERR("lttng_ust_cancelstate_disable_pop");
}
}
}
}
@@
-1459,8
+1448,7
@@
void cleanup_sock_info(struct sock_info *sock_info, int exiting)
}
sock_info->root_handle = -1;
}
}
sock_info->root_handle = -1;
}
- sock_info->registration_done = 0;
- sock_info->initial_statedump_done = 0;
+
/*
* wait_shm_mmap, socket and notify socket are used by listener
/*
* wait_shm_mmap, socket and notify socket are used by listener
@@
-1472,6
+1460,9
@@
void cleanup_sock_info(struct sock_info *sock_info, int exiting)
if (exiting)
return;
if (exiting)
return;
+ sock_info->registration_done = 0;
+ sock_info->initial_statedump_done = 0;
+
if (sock_info->socket != -1) {
ret = ustcomm_close_unix_sock(sock_info->socket);
if (ret) {
if (sock_info->socket != -1) {
ret = ustcomm_close_unix_sock(sock_info->socket);
if (ret) {
This page took
0.026709 seconds
and
4
git commands to generate.