diff options
author | Oskar <[email protected]> | 2024-09-10 16:14:08 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-09-10 16:14:08 +0200 |
commit | 52667b20d637460e5e4d9cf8a30bb04d459dab84 (patch) | |
tree | 60003bc4739e046646d70f5c4634415804c300a5 | |
parent | 6cd56a6a0b1cd51027f216e11ba98bac73736ba7 (diff) |
test
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | trashsys.c | 6 |
2 files changed, 11 insertions, 7 deletions
@@ -1,6 +1,6 @@ CC=gcc -CFLAGS_TESTBIN=-O0 -Wfatal-errors -Wall -Werror -Wextra -g3 -fsanitize=address -fsanitize=leak -Wpedantic -Wformat=2 -Wshadow -Wformat-truncation=2 -Wformat-overflow -fno-common -std=gnu99 -CFLAGS=-O3 -flto -march=native -DNDEBUG -fomit-frame-pointer -s -static -std=gnu99 +CFLAGS_TESTBIN=-O0 -Wfatal-errors -Wall -Werror -Wextra -g3 -fsanitize=address -fsanitize=leak -Wpedantic -Wformat=2 -Wshadow -Wformat-truncation=2 -Wformat-overflow -fno-common -std=c99 +CFLAGS=-O3 -flto -march=native -DNDEBUG -fomit-frame-pointer -s -static -std=c99 TARGET=tsr TESTTARGET=tsr-TESTING SP_TESTTARGET=tsr-SP @@ -8,7 +8,7 @@ INSTALL_DIRECTORY=/usr/local/bin MAKEFLAGS += SRCS=trashsys.c SRCS_SP=trashsys_small_paths.c -P_MAX_SIZE="47" +#P_MAX_SIZE="47" all: release clean: @@ -20,9 +20,9 @@ clean: tests: cp $(SRCS) $(SRCS_SP) $(CC) $(CFLAGS_TESTBIN) $(SRCS) -o test/$(TESTTARGET) - sed -i "s#PATH_MAX#$(P_MAX_SIZE)#g" $(SRCS_SP) - $(CC) $(CFLAGS_TESTBIN) $(SRCS_SP) -o test/$(SP_TESTTARGET) - rm -f $(SRCS_SP) + #sed -i "s#PATH_MAX#$(P_MAX_SIZE)#g" $(SRCS_SP) + #$(CC) $(CFLAGS_TESTBIN) $(SRCS_SP) -o test/$(SP_TESTTARGET) + #rm -f $(SRCS_SP) install: cp $(TARGET) $(INSTALL_DIRECTORY) @@ -15,7 +15,7 @@ #include <stdarg.h> #include <limits.h> #include <sys/stat.h> - +#define PATH_MAX 4096 #define USAGE "tsr [-vt] [-y][-n][-f][-a][-l][-L][-c][-C][-h][-R id] [FILE(s)]\n" #define LONG_USAGE "tsr [options] filename(s)\n"\ "\n"\ @@ -987,8 +987,10 @@ int restore_file (unsigned long long ID, struct initial_path_info *ipi) { free_lfc(lfc); return FUNCTION_FAILURE; } + fprintf(stdout, "Restored to: %s\n", walk->originalpath); } + free_lfc(lfc); return FUNCTION_SUCCESS; } @@ -1163,6 +1165,7 @@ int main (int argc, char *argv[]) { fprintf(stderr, "%s: failed to restore file."/* Please run %s -i to check for inconsistencies."*/, g_argv/*, g_argv*/); return EXIT_FAILURE; } + return EXIT_SUCCESS; } @@ -1171,6 +1174,7 @@ int main (int argc, char *argv[]) { fprintf(stderr, "%s: There was an error clearing old files.", g_argv); return EXIT_FAILURE; } + return EXIT_SUCCESS; } |