summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-05-23 17:11:23 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-24 09:00:50 -0400
commitd9b3196d6c8f4fa0e7d0a4771040762edaebb1ee (patch)
treef378d6955cf3cd6817a47e3a95284441552b221e /parse.c
parent28bbaeac8058653a4a46ae439c37d251a550f4f9 (diff)
downloadbfs-d9b3196d6c8f4fa0e7d0a4771040762edaebb1ee.tar.xz
fsade: Refactor the POSIX.1e abstractions
Since we're going to want to abstract more things that aren't part of POSIX.1e (like xattrs) in a similar way, let's give this a more generic name. And while we're at it, give it some more precise error reporting, and add some tests.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/parse.c b/parse.c
index 4be493b..dbca7a9 100644
--- a/parse.c
+++ b/parse.c
@@ -28,8 +28,8 @@
#include "eval.h"
#include "exec.h"
#include "expr.h"
+#include "fsade.h"
#include "mtab.h"
-#include "posix1e.h"
#include "printf.h"
#include "stat.h"
#include "typo.h"
@@ -999,12 +999,11 @@ static struct expr *parse_access(struct parser_state *state, int flag, int arg2)
* Parse -acl.
*/
static struct expr *parse_acl(struct parser_state *state, int flag, int arg2) {
-#if BFS_HAS_SYS_ACL
+#if BFS_CAN_CHECK_ACL
struct expr *expr = parse_nullary_test(state, eval_acl);
if (expr) {
expr->cost = STAT_COST;
expr->probability = 0.00002;
- expr->ephemeral_fds = 1;
}
return expr;
#else
@@ -1057,12 +1056,11 @@ static struct expr *parse_time(struct parser_state *state, int field, int unit)
* Parse -capable.
*/
static struct expr *parse_capable(struct parser_state *state, int flag, int arg2) {
-#if BFS_HAS_POSIX1E_CAPABILITIES
+#if BFS_CAN_CHECK_CAPABILITIES
struct expr *expr = parse_nullary_test(state, eval_capable);
if (expr) {
expr->cost = STAT_COST;
expr->probability = 0.000002;
- expr->ephemeral_fds = 1;
}
return expr;
#else
@@ -2427,7 +2425,7 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) {
cfprintf(cout, "${bld}Tests:${rs}\n\n");
-#if BFS_HAS_SYS_ACL
+#if BFS_CAN_CHECK_ACL
cfprintf(cout, " ${blu}-acl${rs}\n");
cfprintf(cout, " Find files with non-trivial Access Control Lists\n");
#endif
@@ -2438,7 +2436,7 @@ static struct expr *parse_help(struct parser_state *state, int arg1, int arg2) {
"modified\n");
cfprintf(cout, " ${blu}-${rs}[${blu}aBcm${rs}]${blu}time${rs} ${bld}[-+]N${rs}\n");
cfprintf(cout, " Find files ${blu}a${rs}ccessed/${blu}B${rs}irthed/${blu}c${rs}hanged/${blu}m${rs}odified ${bld}N${rs} days ago\n");
-#if BFS_HAS_POSIX1E_CAPABILITIES
+#if BFS_CAN_CHECK_CAPABILITIES
cfprintf(cout, " ${blu}-capable${rs}\n");
cfprintf(cout, " Match files with POSIX.1e capabilities set\n");
#endif