summaryrefslogtreecommitdiffstats
path: root/sys-utils/setpriv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/setpriv.c')
-rw-r--r--sys-utils/setpriv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c
index 743fd9218..ab3180ac5 100644
--- a/sys-utils/setpriv.c
+++ b/sys-utils/setpriv.c
@@ -541,8 +541,9 @@ static void do_apparmor_profile(const char *label)
err(SETPRIV_EXIT_PRIVERR,
_("cannot open %s"), _PATH_PROC_ATTR_EXEC);
- if (fprintf(f, "changeprofile %s", label) < 0 || fflush(f) != 0
- || fclose(f) != 0)
+ fprintf(f, "changeprofile %s", label);
+
+ if (close_stream(f) != 0)
err(SETPRIV_EXIT_PRIVERR,
_("write failed: %s"), _PATH_PROC_ATTR_EXEC);
}