projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import libtap from babeltrace
[lttng-ust.git]
/
liblttng-ust-comm
/
lttng-ust-comm.c
diff --git
a/liblttng-ust-comm/lttng-ust-comm.c
b/liblttng-ust-comm/lttng-ust-comm.c
index 8e17e41726f60f499d81cc3ad6a0cdb2149cf438..8141ace369731e3024496f4582e803ebc84c3f9a 100644
(file)
--- a/
liblttng-ust-comm/lttng-ust-comm.c
+++ b/
liblttng-ust-comm/lttng-ust-comm.c
@@
-70,19
+70,18
@@
static const char *ustcomm_readable_code[] = {
/*
* lttng_ust_strerror
/*
* lttng_ust_strerror
+ * @code: must be a negative value of enum lttng_ust_error_code (or 0).
*
*
- * Receives positive error value.
- * Return ptr to string representing a human readable
- * error code from the ustcomm_return_code enum.
+ * Returns a ptr to a string representing a human readable error code from the
+ * ustcomm_return_code enum.
*/
const char *lttng_ust_strerror(int code)
{
*/
const char *lttng_ust_strerror(int code)
{
- if (code == LTTNG_UST_OK)
- return ustcomm_readable_code[USTCOMM_CODE_OFFSET(code)];
- if (code < LTTNG_UST_ERR)
- return strerror(code);
- if (code >= LTTNG_UST_ERR_NR)
+ code = -code;
+
+ if (code < LTTNG_UST_OK || code >= LTTNG_UST_ERR_NR)
code = LTTNG_UST_ERR;
code = LTTNG_UST_ERR;
+
return ustcomm_readable_code[USTCOMM_CODE_OFFSET(code)];
}
return ustcomm_readable_code[USTCOMM_CODE_OFFSET(code)];
}
@@
-1332,7
+1331,7
@@
int serialize_entries(struct ustctl_enum_entry **_entries,
strncpy(uentry->string, lentry->string, LTTNG_UST_ABI_SYM_NAME_LEN);
uentry->string[LTTNG_UST_ABI_SYM_NAME_LEN - 1] = '\0';
strncpy(uentry->string, lentry->string, LTTNG_UST_ABI_SYM_NAME_LEN);
uentry->string[LTTNG_UST_ABI_SYM_NAME_LEN - 1] = '\0';
- if (lentry->options & LTTNG_ENUM_ENTRY_OPTION_IS_AUTO) {
+ if (lentry->options & LTTNG_
UST_
ENUM_ENTRY_OPTION_IS_AUTO) {
uentry->u.extra.options |=
USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO;
}
uentry->u.extra.options |=
USTCTL_UST_ENUM_ENTRY_OPTION_IS_AUTO;
}
This page took
0.024554 seconds
and
4
git commands to generate.