Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
5ee7b794
Commit
5ee7b794
authored
Aug 11, 2010
by
Ivan Krasin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added stub for receive_fuse_conn
parent
376d1aa1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
fuse/Makefile
fuse/Makefile
+3
-0
fuse/fuse.go
fuse/fuse.go
+19
-1
fuse/utils.c
fuse/utils.c
+7
-0
No files found.
fuse/Makefile
View file @
5ee7b794
...
...
@@ -7,5 +7,8 @@ GOFILES=\
fuse.go
\
types.go
\
OFILES
=
\
utils.
$O
\
include
$(GOROOT)/src/Make.pkg
fuse/fuse.go
View file @
5ee7b794
...
...
@@ -14,6 +14,7 @@ type FileSystem interface {
type
MountPoint
struct
{
mountPoint
string
f
*
os
.
File
}
// Mount create a fuse fs on the specified mount point.
...
...
@@ -48,7 +49,11 @@ func Mount(mountPoint string, fs FileSystem) (m *MountPoint, err os.Error) {
if
w
.
ExitStatus
()
!=
0
{
return
nil
,
os
.
NewError
(
fmt
.
Sprintf
(
"fusermount exited with code %d
\n
"
,
w
.
ExitStatus
()))
}
m
=
&
MountPoint
{
mountPoint
}
f
,
err
:=
getFuseConn
(
local
)
if
err
!=
nil
{
return
}
m
=
&
MountPoint
{
mountPoint
,
f
}
return
}
...
...
@@ -68,6 +73,19 @@ func (m *MountPoint) Unmount() (err os.Error) {
if
w
.
ExitStatus
()
!=
0
{
return
os
.
NewError
(
fmt
.
Sprintf
(
"fusermount exited with code %d
\n
"
,
w
.
ExitStatus
()))
}
m
.
f
.
Close
()
return
}
func
getFuseConn
(
local
net
.
Conn
)
(
f
*
os
.
File
,
err
os
.
Error
)
{
var
fd
int
errno
:=
receive_fuse_conn
(
local
.
File
()
.
Fd
(),
&
fd
)
if
errno
!=
0
{
return
nil
,
os
.
NewError
(
fmt
.
Sprintf
(
"receive_fuse_conn failed with errno: %d"
,
errno
))
}
f
=
os
.
NewFile
(
fd
,
"fuse-conn"
)
return
}
func
receive_fuse_conn
(
fd
int
,
fuse_fd
*
int
)
int
fuse/utils.c
0 → 100644
View file @
5ee7b794
int
receive_fuse_conn
(
int
fd
,
int
*
fuse_fd
)
{
if
(
fd
<
0
)
{
return
-
1
;
}
*
fuse_fd
=
-
1
;
return
-
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment