From b693718afc7b74fb66a5b4d53b18af615be6848a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Fri, 22 Dec 2017 18:09:33 +0200 Subject: [PATCH] Fixing creation of upload directory --- server/server/connection.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/server/connection.go b/server/server/connection.go index 80dc692..c73c348 100644 --- a/server/server/connection.go +++ b/server/server/connection.go @@ -293,16 +293,16 @@ func StartUploadServer(wg *sync.WaitGroup) error { uploadListener, err = net.Listen("tcp", fmt.Sprintf("%s:%d", addr, port)) if err != nil { log.Println(err) - return err + goto exit } defer uploadListener.Close() - err = os.Mkdir(uploadDirectory, 0740) + err = os.Mkdir(BasePath+"/"+uploadDirectory, 0740) if err != nil { - if _, err := os.Stat(uploadDirectory); err != nil { + if _, err := os.Stat(BasePath + "/" + uploadDirectory); err != nil { if os.IsNotExist(err) { log.Println("Can't create upload directory!") - return err + goto exit } } }