diff options
| author | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-30 02:21:43 +0200 |
|---|---|---|
| committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-30 02:25:05 +0200 |
| commit | affb59fb8c621f7f09902a824c6acfcfecaa7745 (patch) | |
| tree | f8153e81d6c3f8ce4a39c7580a69a0c53b132c63 /testing/clsync/musl-fix.patch | |
| parent | f625013a34ed3b3129cacf92a271ebaf15dd1d0b (diff) | |
| download | aports-affb59fb8c621f7f09902a824c6acfcfecaa7745.tar.bz2 aports-affb59fb8c621f7f09902a824c6acfcfecaa7745.tar.xz | |
testing/clsync: new aport
https://github.com/xaionaro/clsync
File live sync daemon based on inotify
Diffstat (limited to 'testing/clsync/musl-fix.patch')
| -rw-r--r-- | testing/clsync/musl-fix.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/clsync/musl-fix.patch b/testing/clsync/musl-fix.patch new file mode 100644 index 0000000000..a0dc31e9f2 --- /dev/null +++ b/testing/clsync/musl-fix.patch @@ -0,0 +1,32 @@ +musl declares lstat64 only for GNU compatibility using macro +`#define lstat64 lstat`. Local variable lstat in mon_gio overrides +global function lstat from sys/stat.h. + +Upstream issue: https://github.com/xaionaro/clsync/issues/150 +--- a/mon_gio.c ++++ b/mon_gio.c +@@ -305,18 +305,18 @@ + count = 0; + while (gio_wait(ctx_p, indexes_p, &tv)) { + event_t *ev = event_pop(); +- stat64_t lstat, *lstat_p; ++ stat64_t _lstat, *lstat_p; + mode_t st_mode; + size_t st_size; +- if ((ev->objtype_new == EOT_DOESNTEXIST) || (ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT) || lstat64(ev->path, &lstat)) { +- debug(2, "Cannot lstat64(\"%s\", lstat). Seems, that the object had been deleted (%i) or option \"--cancel-syscalls mon_stat\" (%i) is set.", ev->path, ev->objtype_new == EOT_DOESNTEXIST, ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT); ++ if ((ev->objtype_new == EOT_DOESNTEXIST) || (ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT) || lstat64(ev->path, &_lstat)) { ++ debug(2, "Cannot lstat64(\"%s\", _lstat). Seems, that the object had been deleted (%i) or option \"--cancel-syscalls mon_stat\" (%i) is set.", ev->path, ev->objtype_new == EOT_DOESNTEXIST, ctx_p->flags[CANCEL_SYSCALLS]&CSC_MON_STAT); + st_mode = (ev->objtype_event == EOT_DIR ? S_IFDIR : S_IFREG); + st_size = 0; + lstat_p = NULL; + } else { +- st_mode = lstat.st_mode; +- st_size = lstat.st_size; +- lstat_p = &lstat; ++ st_mode = _lstat.st_mode; ++ st_size = _lstat.st_size; ++ lstat_p = &_lstat; + } + + if (sync_prequeue_loadmark(1, ctx_p, indexes_p, NULL, ev->path, lstat_p, ev->objtype_old, ev->objtype_new, ev->event_id, ev->handle_id, st_mode, st_size, &path_full, &path_full_len, NULL)) { |
