projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up: Coding style conformance adjustments in lttng-crash.c
[lttng-tools.git]
/
src
/
bin
/
lttng-crash
/
lttng-crash.c
diff --git
a/src/bin/lttng-crash/lttng-crash.c
b/src/bin/lttng-crash/lttng-crash.c
index 4d186dd557fb995ecbfd3b29f8637d63110b59d2..45fe71be7b67aadbb83a7b3a1d357a21171571a7 100644
(file)
--- a/
src/bin/lttng-crash/lttng-crash.c
+++ b/
src/bin/lttng-crash/lttng-crash.c
@@
-34,6
+34,7
@@
#include <dirent.h>
#include <byteswap.h>
#include <inttypes.h>
#include <dirent.h>
#include <byteswap.h>
#include <inttypes.h>
+#include <stdbool.h>
#include <version.h>
#include <lttng/lttng.h>
#include <version.h>
#include <lttng/lttng.h>
@@
-1138,7
+1139,8
@@
int view_trace(const char *viewer_path, const char *trace_path)
*/
int main(int argc, char *argv[])
{
*/
int main(int argc, char *argv[])
{
- int ret, has_warning = 0;
+ int ret;
+ bool has_warning = false;
const char *output_path = NULL;
char tmppath[] = "/tmp/lttng-crash-XXXXXX";
const char *output_path = NULL;
char tmppath[] = "/tmp/lttng-crash-XXXXXX";
@@
-1146,9
+1148,10
@@
int main(int argc, char *argv[])
ret = parse_args(argc, argv);
if (ret > 0) {
ret = parse_args(argc, argv);
if (ret > 0) {
-
exit(EXIT_SUCCESS)
;
+
goto end
;
} else if (ret < 0) {
} else if (ret < 0) {
- exit(EXIT_FAILURE);
+ has_warning = true;
+ goto end;
}
if (opt_output_path) {
}
if (opt_output_path) {
@@
-1156,34
+1159,38
@@
int main(int argc, char *argv[])
ret = mkdir(output_path, S_IRWXU | S_IRWXG);
if (ret) {
PERROR("mkdir");
ret = mkdir(output_path, S_IRWXU | S_IRWXG);
if (ret) {
PERROR("mkdir");
- exit(EXIT_FAILURE);
+ has_warning = true;
+ goto end;
}
} else {
output_path = mkdtemp(tmppath);
if (!output_path) {
PERROR("mkdtemp");
}
} else {
output_path = mkdtemp(tmppath);
if (!output_path) {
PERROR("mkdtemp");
- exit(EXIT_FAILURE);
+ has_warning = true;
+ goto end;
}
}
ret = extract_trace_recursive(output_path, input_path);
if (ret < 0) {
}
}
ret = extract_trace_recursive(output_path, input_path);
if (ret < 0) {
- exit(EXIT_FAILURE);
+ has_warning = true;
+ goto end;
} else if (ret > 0) {
} else if (ret > 0) {
- has_warning = 1;
+ /* extract_trace_recursive reported a warning. */
+ has_warning = true;
}
if (!opt_output_path) {
/* View trace */
ret = view_trace(opt_viewer_path, output_path);
}
if (!opt_output_path) {
/* View trace */
ret = view_trace(opt_viewer_path, output_path);
- if (ret)
- has_warning =
1
;
-
+ if (ret)
{
+ has_warning =
true
;
+ }
/* unlink temporary trace */
ret = delete_trace(output_path);
/* unlink temporary trace */
ret = delete_trace(output_path);
- if (ret)
- has_warning = 1;
+ if (ret) {
+ has_warning = true;
+ }
}
}
- if (has_warning)
- exit(EXIT_FAILURE);
- exit(EXIT_SUCCESS);
+end:
+ exit(has_warning ? EXIT_FAILURE : EXIT_SUCCESS);
}
}
This page took
0.025412 seconds
and
4
git commands to generate.