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