diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-27 15:57:38 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-27 15:57:38 +0530 |
commit | b268e78ec0897e5f37616c180eb0e899a2c8f031 (patch) | |
tree | aa91a15cc93b3a627d1b29139cea79c11ece4727 /src/copy.c | |
parent | 7c13ed35bba1bc52cb21fd44ae9a99d3ddf348f4 (diff) |
main: introduce global msg_t and don't hardcode directory
Diffstat (limited to 'src/copy.c')
-rw-r--r-- | src/copy.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -4,11 +4,14 @@ #include <fcntl.h> #include <filehandler.h> #include <ftw.h> +#include <main.h> #include <string.h> #include <sys/sendfile.h> #include <sys/stat.h> #include <unistd.h> +extern msg_t *msg; + int copy_recursively(const char *fpath, const struct stat *sb, @@ -18,7 +21,7 @@ copy_recursively(const char *fpath, (void) sb; (void) ftwbuf; - const char *path = fpath + strlen(DIRECTORY) + 1; + const char *path = fpath + strlen(msg->base_directory) + 1; char *output_path = NULL; asprintf(&output_path, "%s/%s", OUTPUT, path); |