Follow-up to db840bd, use systemf() to simplify tmpfiles evn further

Also, added benefit, we don't get compiler warnings for ignoring the
return value of system(), which we don't care about in this case.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-07-06 14:38:27 +02:00
parent 9f95934df9
commit d652211621
+2 -4
View File
@@ -516,10 +516,8 @@ static void tmpfiles(char *line)
if (glob(path, GLOB_NOESCAPE, NULL, &gl))
break;
for (size_t i = 0; i < gl.gl_pathc; i++) {
snprintf(buf, sizeof(buf), "restorecon %s %s", opts, gl.gl_pathv[i]);
system(buf);
}
for (size_t i = 0; i < gl.gl_pathc; i++)
systemf("restorecon %s %s", opts, gl.gl_pathv[i]);
break;
default:
errx(1, "Unsupported tmpfiles command '%s'", type);