projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
signal fix, take 2
[lttv.git]
/
ltt-usertrace
/
ltt
/
ltt-facility-custom-user_generic.h
diff --git
a/ltt-usertrace/ltt/ltt-facility-custom-user_generic.h
b/ltt-usertrace/ltt/ltt-facility-custom-user_generic.h
index c819e3aa597564077b509a7f5f31a4fd28156fec..9b56ff8f3eacf7a3e816112df398bac35e8fcf37 100644
(file)
--- a/
ltt-usertrace/ltt/ltt-facility-custom-user_generic.h
+++ b/
ltt-usertrace/ltt/ltt-facility-custom-user_generic.h
@@
-8,6
+8,10
@@
#include <stdlib.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdarg.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static int trace_user_generic_slow_printf(
const char *fmt, ...)
#ifndef LTT_TRACE
static int trace_user_generic_slow_printf(
const char *fmt, ...)
#ifndef LTT_TRACE
@@
-16,11
+20,12
@@
static int trace_user_generic_slow_printf(
#else
{
/* Guess we need no more than 100 bytes. */
#else
{
/* Guess we need no more than 100 bytes. */
- int n, size = 10
0
;
+ int n, size = 10
4
;
char *p, *np;
va_list ap;
int ret;
char *p, *np;
va_list ap;
int ret;
+ size += ltt_align(size, sizeof(void*));
if ((p = malloc (size)) == NULL)
return -1;
if ((p = malloc (size)) == NULL)
return -1;
@@
-31,7
+36,7
@@
static int trace_user_generic_slow_printf(
va_end(ap);
/* If that worked, trace the string. */
if (n > -1 && n < size) {
va_end(ap);
/* If that worked, trace the string. */
if (n > -1 && n < size) {
- ret = trace_user_generic_slow_printf_param_buffer(p, n+1);
+ ret = trace_user_generic_slow_printf_param_buffer(p, n+1
+ltt_align(n+1, sizeof(void*))
);
free(p);
return ret;
}
free(p);
return ret;
}
@@
-40,6
+45,7
@@
static int trace_user_generic_slow_printf(
size = n+1; /* precisely what is needed */
else /* glibc 2.0 */
size *= 2; /* twice the old size */
size = n+1; /* precisely what is needed */
else /* glibc 2.0 */
size *= 2; /* twice the old size */
+ size += ltt_align(size, sizeof(void*));
if ((np = realloc (p, size)) == NULL) {
free(p);
return -1;
if ((np = realloc (p, size)) == NULL) {
free(p);
return -1;
@@
-50,4
+56,8
@@
static int trace_user_generic_slow_printf(
}
#endif //LTT_TRACE
}
#endif //LTT_TRACE
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
+
#endif //_LTT_FACILITY_CUSTOM_USER_GENERIC_H_
#endif //_LTT_FACILITY_CUSTOM_USER_GENERIC_H_
This page took
0.023486 seconds
and
4
git commands to generate.