Prepare to add the removing of labels and also reduce
the count of tests.
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
option_flag = 1;
}
- for (i = optind; i < argc; i++) {
- if (option_flag) {
+ /* setting labels */
+ if (option_flag) {
+ for (i = optind; i < argc; i++) {
if (strlen(access_buf) > 0) {
rc = smack_set_label_for_path(argv[i],
XATTR_NAME_SMACK, 0, access_buf);
if (rc < 0)
perror(argv[i]);
}
- } else {
+ }
+ }
+
+ /* listing labels */
+ else {
+ for (i = optind; i < argc; i++) {
+
/* Print file path. */
printf("%s", argv[i]);