summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--Makefile8
-rw-r--r--eval.c9
-rw-r--r--parse.c6
-rwxr-xr-xtests.sh6
5 files changed, 23 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
index 5fe37e0..8b3d780 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,6 +2,7 @@ language: c
dist: focal
virt: lxd
+group: edge
script: make -j$TRAVIS_NUMCORES distcheck
diff --git a/Makefile b/Makefile
index cdbf664..832586a 100644
--- a/Makefile
+++ b/Makefile
@@ -169,6 +169,10 @@ $(BIN_GOALS):
%.o: %.c .flags
$(CC) $(ALL_CFLAGS) -c $< -o $@
+# Need a rule for .flags to convince make to apply the above pattern rule if
+# .flags didn't exist when make was run
+.flags:
+
# Make sure that "make release" builds everything, but "make release main.o" doesn't
$(FLAG_GOALS): $(FLAG_PREREQS)
@:
@@ -193,7 +197,7 @@ endif
+$(MAKE) -B check $(DISTCHECK_FLAGS)
clean:
- $(RM) $(BIN_GOALS) *.[od] *.gcda *.gcno tests/*.[od] tests/*.gcda tests/*.gcno
+ $(RM) $(BIN_GOALS) .flags *.[od] *.gcda *.gcno tests/*.[od] tests/*.gcda tests/*.gcno
install:
$(MKDIR) $(DESTDIR)$(PREFIX)/bin
@@ -207,4 +211,6 @@ uninstall:
.PHONY: default all $(FLAG_GOALS) check $(CHECKS) distcheck clean install uninstall
+.SUFFIXES:
+
-include $(wildcard *.d)
diff --git a/eval.c b/eval.c
index bb93c12..6abdaf2 100644
--- a/eval.c
+++ b/eval.c
@@ -261,8 +261,13 @@ bool eval_used(const struct expr *expr, struct eval_state *state) {
return false;
}
- time_t diff = timespec_diff(atime, ctime);
- diff /= 60*60*24;
+ long long diff = timespec_diff(atime, ctime);
+ if (diff < 0) {
+ return false;
+ }
+
+ long long day_seconds = 60*60*24;
+ diff = (diff + day_seconds - 1) / day_seconds;
return expr_cmp(expr, diff);
}
diff --git a/parse.c b/parse.c
index 4e326ec..fa95e69 100644
--- a/parse.c
+++ b/parse.c
@@ -1896,8 +1896,10 @@ static int parse_mode(const struct parser_state *state, const char *mode, struct
}
break;
case 't':
- file_change |= S_ISVTX;
- dir_change |= S_ISVTX;
+ if (who & 0007) {
+ file_change |= S_ISVTX;
+ dir_change |= S_ISVTX;
+ }
break;
default:
mstate = MODE_ACTION_APPLY;
diff --git a/tests.sh b/tests.sh
index 0e1a964..c8e94a8 100755
--- a/tests.sh
+++ b/tests.sh
@@ -406,6 +406,9 @@ bsd_tests=(
test_size_big
test_uid_name
+
+ # Optimizer tests
+ test_data_flow_sparse
)
gnu_tests=(
@@ -603,7 +606,6 @@ gnu_tests=(
test_and_false_or_true
test_comma_redundant_true
test_comma_redundant_false
- test_data_flow_sparse
)
bfs_tests=(
@@ -1762,7 +1764,7 @@ function test_perm_setid() {
}
function test_perm_sticky() {
- bfs_diff rainbow -perm /ug+t
+ bfs_diff rainbow -perm /+t
}
function test_prune() {