summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-03-03 18:57:52 +0300
committerValery Piashchynski <[email protected]>2020-03-03 18:57:52 +0300
commitaa0ba5496c101e41a497285b4e0f4e9f2820b5e7 (patch)
treedadbacfbbcd99e2306fa0996393b31106a0542bb /util
parent9fabf648f1c3cb797ec03377c3e2182397fb7a1a (diff)
Fix typos
Update signals handling mechanism http proper stopping
Diffstat (limited to 'util')
-rw-r--r--util/network_windows.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/util/network_windows.go b/util/network_windows.go
index e5bc67c8..843d5779 100644
--- a/util/network_windows.go
+++ b/util/network_windows.go
@@ -30,4 +30,14 @@ func CreateListener(address string) (net.Listener, error) {
}
return net.Listen(dsn[0], dsn[1])
-} \ No newline at end of file
+}
+
+// fileExists checks if a file exists and is not a directory before we
+// try using it to prevent further errors.
+func fileExists(filename string) bool {
+ info, err := os.Stat(filename)
+ if os.IsNotExist(err) {
+ return false
+ }
+ return !info.IsDir()
+}