1
0

Defered unix socket removing instead.

This commit is contained in:
Alexander Andreev 2022-02-14 20:21:19 +04:00
parent 7cb312f5b9
commit 85b8eb4876
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -47,6 +47,12 @@ func main() {
log.Fatalln(err) log.Fatalln(err)
} }
defer func() {
if nt, addr := config.SplitNetworkAddress(); nt == "unix" {
os.Remove(addr)
}
}()
if config.Chroot != "" { if config.Chroot != "" {
if err := syscall.Chroot(config.Chroot); err != nil { if err := syscall.Chroot(config.Chroot); err != nil {
log.Fatalln("failed to chroot:", err) log.Fatalln("failed to chroot:", err)
@ -122,10 +128,6 @@ func main() {
logErr.Fatalln(err) logErr.Fatalln(err)
} }
if nt, addr := config.SplitNetworkAddress(); nt == "unix" {
os.Remove(addr)
}
closeSignal <- true closeSignal <- true
case <-uploadDirNotify: case <-uploadDirNotify:
sz, err := utils.DirectorySize(config.Uploads.Directory) sz, err := utils.DirectorySize(config.Uploads.Directory)