Skip to content

Commit 9bf942f

Browse files
walaclenticularis39
authored andcommitted
rtla: Use standard exit codes for result enum
The result enum defines custom values for PASSED, ERROR, and FAILED. These values correspond to standard exit codes EXIT_SUCCESS and EXIT_FAILURE. Update the enum to use the standard macros EXIT_SUCCESS and EXIT_FAILURE to improve readability and adherence to standard C practices. The FAILED value is implicitly assigned EXIT_FAILURE + 1, so there is no need to assign an explicit value. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Link: https://lore.kernel.org/r/20260106133655.249887-9-wander@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>
1 parent 7e9dfcc commit 9bf942f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

tools/tracing/rtla/src/utils.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <time.h>
55
#include <sched.h>
66
#include <stdbool.h>
7+
#include <stdlib.h>
78

89
/*
910
* '18446744073709551615\0'
@@ -88,7 +89,7 @@ __attribute__((__warn_unused_result__)) int strtoi(const char *s, int *res);
8889
#define ns_to_per(total, part) ((part * 100) / (double)total)
8990

9091
enum result {
91-
PASSED = 0, /* same as EXIT_SUCCESS */
92-
ERROR = 1, /* same as EXIT_FAILURE, an error in arguments */
93-
FAILED = 2, /* test hit the stop tracing condition */
92+
PASSED = EXIT_SUCCESS,
93+
ERROR = EXIT_FAILURE,
94+
FAILED, /* test hit the stop tracing condition */
9495
};

0 commit comments

Comments
 (0)