diff --git a/usr.sbin/fstyp/fstyp.c b/usr.sbin/fstyp/fstyp.c index 4678a5e3e959..31f7b34bde40 100644 --- a/usr.sbin/fstyp/fstyp.c +++ b/usr.sbin/fstyp/fstyp.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -191,8 +192,7 @@ main(int argc, char **argv) if (fp == NULL) err(1, "%s", path); - error = cap_enter(); - if (error != 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); if (ignore_type == false) diff --git a/usr.sbin/uefisign/child.c b/usr.sbin/uefisign/child.c index 6648d19f4efa..9e5607dc035c 100644 --- a/usr.sbin/uefisign/child.c +++ b/usr.sbin/uefisign/child.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -228,7 +229,6 @@ int child(const char *inpath, const char *outpath, int pipefd, bool Vflag, bool vflag) { - int error; FILE *outfp = NULL, *infp = NULL; struct executable *x; @@ -236,8 +236,7 @@ child(const char *inpath, const char *outpath, int pipefd, if (outpath != NULL) outfp = checked_fopen(outpath, "w"); - error = cap_enter(); - if (error != 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); x = calloc(1, sizeof(*x));