aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--checkdir.go4
-rw-r--r--daemonize.go10
-rw-r--r--main.go18
3 files changed, 16 insertions, 16 deletions
diff --git a/checkdir.go b/checkdir.go
index 182bf97..b597834 100644
--- a/checkdir.go
+++ b/checkdir.go
@@ -1,8 +1,8 @@
package main
import (
- "io/ioutil"
"fmt"
+ "io/ioutil"
"os"
)
@@ -26,7 +26,7 @@ func checkDir(dir string) error {
if err != nil {
return err
}
- if ! fi.IsDir() {
+ if !fi.IsDir() {
return fmt.Errorf("%s is not a directory")
}
return nil
diff --git a/daemonize.go b/daemonize.go
index 87faf33..e93c264 100644
--- a/daemonize.go
+++ b/daemonize.go
@@ -1,11 +1,11 @@
package main
import (
- "syscall"
- "os/exec"
- "os"
"fmt"
+ "os"
+ "os/exec"
"os/signal"
+ "syscall"
)
// The child sends us USR1 if the mount was successful
@@ -36,8 +36,8 @@ func daemonize() {
if err != nil {
if exiterr, ok := err.(*exec.ExitError); ok {
if waitstat, ok := exiterr.Sys().(syscall.WaitStatus); ok {
- os.Exit(waitstat.ExitStatus())
- }
+ os.Exit(waitstat.ExitStatus())
+ }
}
fmt.Printf("daemonize: wait returned an unknown error: %v\n", err)
os.Exit(1)
diff --git a/main.go b/main.go
index d4ec227..5a9953e 100644
--- a/main.go
+++ b/main.go
@@ -24,14 +24,14 @@ const (
PROGRAM_NAME = "gocryptfs"
// Exit codes
- ERREXIT_USAGE = 1
- ERREXIT_NEWFS = 2
- ERREXIT_MOUNT = 3
- ERREXIT_SERVE = 4
- ERREXIT_CIPHERDIR = 6
- ERREXIT_INIT = 7
- ERREXIT_LOADCONF = 8
- ERREXIT_PASSWORD = 9
+ ERREXIT_USAGE = 1
+ ERREXIT_NEWFS = 2
+ ERREXIT_MOUNT = 3
+ ERREXIT_SERVE = 4
+ ERREXIT_CIPHERDIR = 6
+ ERREXIT_INIT = 7
+ ERREXIT_LOADCONF = 8
+ ERREXIT_PASSWORD = 9
ERREXIT_MOUNTPOINT = 10
)
@@ -81,7 +81,7 @@ func main() {
var cpuprofile = flag.String("cpuprofile", "", "Write cpu profile to specified file")
flag.Parse()
- if ! foreground {
+ if !foreground {
daemonize() // does not return
}
if *cpuprofile != "" {