diff options
-rw-r--r-- | .travis.yml | 1 | ||||
-rw-r--r-- | Makefile | 8 | ||||
-rw-r--r-- | eval.c | 9 | ||||
-rw-r--r-- | parse.c | 6 | ||||
-rwxr-xr-x | tests.sh | 6 |
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 @@ -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) @@ -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); } @@ -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; @@ -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() { |