Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
paho.mqtt.c
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eclipse
paho.mqtt.c
Commits
4be97e2d
Commit
4be97e2d
authored
Oct 10, 2013
by
Ian Craggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compile warnings in StackTrace.c and locking scope in Log.c
parent
be218ab6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
Log.c
src/Log.c
+6
-8
StackTrace.c
src/StackTrace.c
+2
-2
No files found.
src/Log.c
View file @
4be97e2d
...
...
@@ -324,7 +324,6 @@ static void Log_output(int log_level, char* msg)
{
if
(
trace_destination
)
{
Thread_lock_mutex
(
log_mutex
);
/* need to lock around the fiddling with the log files */
fprintf
(
trace_destination
,
"%s
\n
"
,
msg
);
if
(
trace_destination
!=
stdout
&&
++
lines_written
>=
max_lines_per_file
)
...
...
@@ -340,7 +339,6 @@ static void Log_output(int log_level, char* msg)
}
else
fflush
(
trace_destination
);
Thread_unlock_mutex
(
log_mutex
);
}
if
(
trace_callback
)
...
...
@@ -393,13 +391,14 @@ static void Log_trace(int log_level, char* buf)
*/
void
Log
(
int
log_level
,
int
msgno
,
char
*
format
,
...)
{
char
*
temp
=
NULL
;
static
char
msg_buf
[
512
];
if
(
log_level
>=
trace_settings
.
trace_level
)
{
char
*
temp
=
NULL
;
static
char
msg_buf
[
512
];
va_list
args
;
/* we're using a static character buffer, so we need to make sure only one thread uses it at a time */
Thread_lock_mutex
(
log_mutex
);
if
(
format
==
NULL
&&
(
temp
=
Messages_get
(
msgno
,
log_level
))
!=
NULL
)
format
=
temp
;
...
...
@@ -408,6 +407,7 @@ void Log(int log_level, int msgno, char* format, ...)
Log_trace
(
log_level
,
msg_buf
);
va_end
(
args
);
Thread_unlock_mutex
(
log_mutex
);
}
/*if (log_level >= LOG_ERROR)
...
...
@@ -415,9 +415,7 @@ void Log(int log_level, int msgno, char* format, ...)
char* filename = NULL;
Log_recordFFDC(&msg_buf[7]);
}
if (log_level == LOG_FATAL)
exit(-1);*/
*/
}
...
...
src/StackTrace.c
View file @
4be97e2d
...
...
@@ -45,14 +45,14 @@ BE*/
typedef
struct
{
unsigned
long
threadid
;
thread_id_type
threadid
;
char
name
[
MAX_FUNCTION_NAME_LENGTH
];
int
line
;
}
stackEntry
;
typedef
struct
{
unsigned
long
id
;
thread_id_type
id
;
int
maxdepth
;
int
current_depth
;
stackEntry
callstack
[
MAX_STACK_DEPTH
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment