diff options
author | Jakob Unterwurzacher | 2024-09-02 16:31:23 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2024-09-02 16:31:23 +0200 |
commit | 40abf968eddd54b6c03ac064d6e42cc6f1083146 (patch) | |
tree | 6f3015b0e56135891e5a211c62b391bb6b36e7a5 /mount.go | |
parent | f665be1178c72a4768e82bccdfa073a0cf309215 (diff) |
ctlsocksrv: move Listen() call here
Prep for solving https://github.com/rfjakob/gocryptfs/issues/776
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -5,7 +5,6 @@ import ( "log" "log/syslog" "math" - "net" "os" "os/exec" "os/signal" @@ -91,16 +90,15 @@ func doMount(args *argContainer) { // We must use an absolute path because we cd to / when daemonizing. // This messes up the delete-on-close logic in the unix socket object. args.ctlsock, _ = filepath.Abs(args.ctlsock) - var sock net.Listener - sock, err = net.Listen("unix", args.ctlsock) + + args._ctlsockFd, err = ctlsocksrv.Listen(args.ctlsock) if err != nil { tlog.Fatal.Printf("ctlsock: %v", err) os.Exit(exitcodes.CtlSock) } - args._ctlsockFd = sock // Close also deletes the socket file defer func() { - err = sock.Close() + err = args._ctlsockFd.Close() if err != nil { tlog.Warn.Printf("ctlsock close: %v", err) } |