aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-01-22 03:41:47 +0100
committerBrian Behlendorf <[email protected]>2022-03-15 15:13:58 -0700
commitc21819026f199869f515e9b8b74ec5cf43a324f1 (patch)
tree55d7b2bdafe80813415b919bd4a8c97a4ab80801 /cmd
parenta9e2b22efb5f028d4b662bc0f6dc84e5461d48ee (diff)
Replace FMD_B_{TRUE,FALSE} with B_{TRUE,FALSE}
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12996
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zed/agents/fmd_api.c6
-rw-r--r--cmd/zed/agents/fmd_api.h7
-rw-r--r--cmd/zed/agents/fmd_serd.c6
3 files changed, 7 insertions, 12 deletions
diff --git a/cmd/zed/agents/fmd_api.c b/cmd/zed/agents/fmd_api.c
index d97f67b4f..e7eff16fd 100644
--- a/cmd/zed/agents/fmd_api.c
+++ b/cmd/zed/agents/fmd_api.c
@@ -342,11 +342,11 @@ fmd_case_uuresolved(fmd_hdl_t *hdl, const char *uuid)
fmd_hdl_debug(hdl, "case resolved by uuid (%s)", uuid);
}
-int
+boolean_t
fmd_case_solved(fmd_hdl_t *hdl, fmd_case_t *cp)
{
(void) hdl;
- return ((cp->ci_state >= FMD_CASE_SOLVED) ? FMD_B_TRUE : FMD_B_FALSE);
+ return (cp->ci_state >= FMD_CASE_SOLVED);
}
void
@@ -560,7 +560,7 @@ fmd_serd_record(fmd_hdl_t *hdl, const char *name, fmd_event_t *ep)
if ((sgp = fmd_serd_eng_lookup(&mp->mod_serds, name)) == NULL) {
zed_log_msg(LOG_ERR, "failed to add record to SERD engine '%s'",
name);
- return (FMD_B_FALSE);
+ return (0);
}
err = fmd_serd_eng_record(sgp, ep->ev_hrt);
diff --git a/cmd/zed/agents/fmd_api.h b/cmd/zed/agents/fmd_api.h
index 4f06fb244..2c55365c3 100644
--- a/cmd/zed/agents/fmd_api.h
+++ b/cmd/zed/agents/fmd_api.h
@@ -72,10 +72,6 @@ typedef struct fmd_case {
} fmd_case_t;
-#define FMD_B_FALSE 0 /* false value for booleans as int */
-#define FMD_B_TRUE 1 /* true value for booleans as int */
-
-
#define FMD_CASE_UNSOLVED 0 /* case is not yet solved (waiting) */
#define FMD_CASE_SOLVED 1 /* case is solved (suspects added) */
#define FMD_CASE_CLOSE_WAIT 2 /* case is executing fmdo_close() */
@@ -176,8 +172,7 @@ extern int fmd_case_uuclosed(fmd_hdl_t *, const char *);
extern int fmd_case_uuisresolved(fmd_hdl_t *, const char *);
extern void fmd_case_uuresolved(fmd_hdl_t *, const char *);
-extern int fmd_case_solved(fmd_hdl_t *, fmd_case_t *);
-extern int fmd_case_closed(fmd_hdl_t *, fmd_case_t *);
+extern boolean_t fmd_case_solved(fmd_hdl_t *, fmd_case_t *);
extern void fmd_case_add_ereport(fmd_hdl_t *, fmd_case_t *, fmd_event_t *);
extern void fmd_case_add_serd(fmd_hdl_t *, fmd_case_t *, const char *);
diff --git a/cmd/zed/agents/fmd_serd.c b/cmd/zed/agents/fmd_serd.c
index 94736ce42..98c752ae7 100644
--- a/cmd/zed/agents/fmd_serd.c
+++ b/cmd/zed/agents/fmd_serd.c
@@ -234,7 +234,7 @@ fmd_serd_eng_record(fmd_serd_eng_t *sgp, hrtime_t hrt)
if (sgp->sg_flags & FMD_SERD_FIRED) {
serd_log_msg(" SERD Engine: record %s already fired!",
sgp->sg_name);
- return (FMD_B_FALSE);
+ return (B_FALSE);
}
while (sgp->sg_count >= sgp->sg_n)
@@ -259,11 +259,11 @@ fmd_serd_eng_record(fmd_serd_eng_t *sgp, hrtime_t hrt)
fmd_event_delta(oep->se_hrt, sep->se_hrt) <= sgp->sg_t) {
sgp->sg_flags |= FMD_SERD_FIRED | FMD_SERD_DIRTY;
serd_log_msg(" SERD Engine: fired %s", sgp->sg_name);
- return (FMD_B_TRUE);
+ return (B_TRUE);
}
sgp->sg_flags |= FMD_SERD_DIRTY;
- return (FMD_B_FALSE);
+ return (B_FALSE);
}
int