summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-11-24 23:31:12 +0100
committerJakob Borg <jakob@nym.se>2014-11-24 23:32:11 +0100
commitb48d9a3a82aa97f1532dc72fd6743e5c1377a7e8 (patch)
treed008e267d885a0ce3f4fdebe3f698ec785a5fae4
parent0255311bbe8bbad540122704819a67a391247c65 (diff)
downloadsyncthing-0.10.8.tar.gz
syncthing-0.10.8.zip
Don't panic when lacking symlink support on XP (fixes #1016)v0.10.8
-rw-r--r--internal/symlinks/symlink_windows.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/symlinks/symlink_windows.go b/internal/symlinks/symlink_windows.go
index 1a99e3db9..93a14b588 100644
--- a/internal/symlinks/symlink_windows.go
+++ b/internal/symlinks/symlink_windows.go
@@ -46,6 +46,15 @@ var (
)
func init() {
+ defer func() {
+ if err := recover(); err != nil {
+ // Ensure that the supported flag is disabled when we hit an
+ // error, even though it should already be. Also, silently swallow
+ // the error since it's fine for a system not to support symlinks.
+ Supported = false
+ }
+ }()
+
// Needs administrator priviledges.
// Let's check that everything works.
// This could be done more officially: