#define FLAG_R (option_mask32 & OPT_R)
-static void qprintf(const char *fmt ATTRIBUTE_UNUSED, ...)
+static void qprintf(const char *fmt UNUSED_PARAM, ...)
{
/* quiet, do nothing */
}
}
}
-static void add_exclude(const char *const directory)
+static void add_exclude(const char *directory)
{
struct stat sb;
size_t len;
* This function is called by recursive_action on each file during
* the directory traversal.
*/
-static int apply_spec(
+static int FAST_FUNC apply_spec(
const char *file,
struct stat *sb,
- void *userData ATTRIBUTE_UNUSED,
- int depth ATTRIBUTE_UNUSED)
+ void *userData UNUSED_PARAM,
+ int depth UNUSED_PARAM)
{
if (!follow_mounts) {
/* setfiles does not process across different mount points */
if ((applet_name[0] == 's') && (flags & OPT_c)) {
FILE *policystream;
- policystream = xfopen(policyfile, "r");
+ policystream = xfopen_for_read(policyfile);
if (sepol_set_policydb_from_file(policystream) < 0) {
bb_error_msg_and_die("sepol_set_policydb_from_file on %s", policyfile);
}
if (flags & OPT_o) {
outfile = stdout;
if (NOT_LONE_CHAR(out_filename, '-')) {
- outfile = xfopen(out_filename, "w");
+ outfile = xfopen_for_write(out_filename);
}
}
if (applet_name[0] == 'r') { /* restorecon */
optind++;
if (nerr)
- exit(1);
+ exit(EXIT_FAILURE);
}
if (input_filename) {
FILE *f = stdin;
if (NOT_LONE_CHAR(input_filename, '-'))
- f = xfopen(input_filename, "r");
+ f = xfopen_for_read(input_filename);
while ((len = getline(&buf, &buf_len, f)) > 0) {
buf[len - 1] = '\0';
errors |= process_one(buf);