Fix error comparison
[appimagekit/gsi.git] / squashfuse.patch
blobdb94d2f7678d24c3990fcbb4e44a1cc55ef12ffb
1 diff --git a/Makefile.am b/Makefile.am
2 index f0d7cde..70c4aa0 100644
3 --- a/Makefile.am
4 +++ b/Makefile.am
5 @@ -14,6 +14,7 @@ bin_PROGRAMS =
6 noinst_PROGRAMS =
8 noinst_LTLIBRARIES = libsquashfuse.la
9 +noinst_LTLIBRARIES += libsquashfuse_ll.la
11 # Main library: libsquashfuse
12 libsquashfuse_la_SOURCES = swap.c cache.c table.c dir.c file.c fs.c \
13 @@ -46,10 +47,9 @@ endif
15 # Low-level squashfuse_ll, if supported
16 if SQ_WANT_LOWLEVEL
17 -bin_PROGRAMS += squashfuse_ll
18 -squashfuse_ll_SOURCES = ll.c ll_inode.c nonstd-daemon.c ll.h
19 -squashfuse_ll_CPPFLAGS = $(FUSE_CPPFLAGS)
20 -squashfuse_ll_LDADD = libsquashfuse.la libfuseprivate.la $(COMPRESSION_LIBS) \
21 +libsquashfuse_ll_la_SOURCES = ll.c ll_inode.c nonstd-daemon.c ll.h
22 +libsquashfuse_ll_la_CPPFLAGS = $(FUSE_CPPFLAGS)
23 +libsquashfuse_ll_la_LIBADD = libsquashfuse.la libfuseprivate.la $(COMPRESSION_LIBS) \
24 $(FUSE_LIBS)
26 noinst_LTLIBRARIES += libfuseprivate.la
27 diff --git a/ll.c b/ll.c
28 index a2c7902..8fcb3f4 100644
29 --- a/ll.c
30 +++ b/ll.c
31 @@ -390,7 +390,7 @@ static sqfs_ll *sqfs_ll_open(const char *path, size_t offset) {
32 return NULL;
35 -int main(int argc, char *argv[]) {
36 +int fusefs_main(int argc, char *argv[], void (*mounted) (void)) {
37 struct fuse_args args;
38 sqfs_opts opts;
40 @@ -451,6 +451,8 @@ int main(int argc, char *argv[]) {
41 if (sqfs_ll_daemonize(fg) != -1) {
42 if (fuse_set_signal_handlers(se) != -1) {
43 fuse_session_add_chan(se, ch.ch);
44 + if (mounted)
45 + mounted ();
46 /* FIXME: multithreading */
47 err = fuse_session_loop(se);
48 fuse_remove_signal_handlers(se);
49 @@ -466,6 +468,8 @@ int main(int argc, char *argv[]) {
52 fuse_opt_free_args(&args);
53 + if (mounted)
54 + rmdir (mountpoint);
55 free(ll);
56 free(mountpoint);