From 52548d0b463784ee0b77295d83df088e86795437 Mon Sep 17 00:00:00 2001 From: Yongwoo Park Date: Thu, 24 Dec 2015 09:53:10 +0900 Subject: [PATCH 1/2] Terminate go-mtpfs when there is no stroages Some devices send storage info with no storage and no reason to mount it --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index ed807e1..0fea99e 100644 --- a/main.go +++ b/main.go @@ -54,6 +54,8 @@ func main() { sids, err := fs.SelectStorages(dev, *storageFilter) if err != nil { log.Fatalf("selectStorages failed: %v", err) + } else if len(sids) == 0 { + log.Fatal("No storages on the device") } opts := fs.DeviceFsOptions{ From 034f95fd4d69abbf56413e3b058a5e4f90933c68 Mon Sep 17 00:00:00 2001 From: Yongwoo Park Date: Fri, 25 Dec 2015 01:14:39 +0900 Subject: [PATCH 2/2] Additional error reason for locked device --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 0fea99e..7c2ee15 100644 --- a/main.go +++ b/main.go @@ -55,7 +55,7 @@ func main() { if err != nil { log.Fatalf("selectStorages failed: %v", err) } else if len(sids) == 0 { - log.Fatal("No storages on the device") + log.Fatal("No storages on the device or Try again after unlock the device") } opts := fs.DeviceFsOptions{