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
Kirill Smelkov
go-fuse
Commits
68cab0c2
Commit
68cab0c2
authored
Dec 08, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup of ToStatus().
parent
21a255f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
fuse/misc.go
fuse/misc.go
+14
-15
No files found.
fuse/misc.go
View file @
68cab0c2
...
...
@@ -32,22 +32,21 @@ func (code Status) Ok() bool {
// Convert error back to Errno based errors.
func
ToStatus
(
err
error
)
Status
{
if
err
!=
nil
{
switch
t
:=
err
.
(
type
)
{
case
syscall
.
Errno
:
return
Status
(
t
)
case
*
os
.
SyscallError
:
return
Status
(
t
.
Errno
.
(
syscall
.
Errno
))
case
*
os
.
PathError
:
return
ToStatus
(
t
.
Err
)
case
*
os
.
LinkError
:
return
ToStatus
(
t
.
Err
)
default
:
log
.
Println
(
"can't convert error type:"
,
err
)
return
ENOSYS
}
if
err
==
nil
{
return
OK
}
return
OK
switch
t
:=
err
.
(
type
)
{
case
syscall
.
Errno
:
return
Status
(
t
)
case
*
os
.
SyscallError
:
return
Status
(
t
.
Errno
.
(
syscall
.
Errno
))
case
*
os
.
PathError
:
return
ToStatus
(
t
.
Err
)
case
*
os
.
LinkError
:
return
ToStatus
(
t
.
Err
)
}
log
.
Println
(
"can't convert error type:"
,
err
)
return
ENOSYS
}
func
splitDuration
(
dt
time
.
Duration
,
secs
*
uint64
,
nsecs
*
uint32
)
{
...
...
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