+12
-0
lines changedFilter options
+12
-0
lines changed Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ var (
30
30
namedPipe = flag.String("winssh", "", "Named pipe for use with Win32 OpenSSH")
31
31
verbose = flag.Bool("verbose", false, "Enable verbose logging")
32
32
systrayFlag = flag.Bool("systray", false, "Enable systray integration")
33
+
force = flag.Bool("force", false, "Force socket usage (unlink existing socket)")
33
34
)
34
35
35
36
const (
@@ -209,6 +210,17 @@ func main() {
209
210
}()
210
211
211
212
if *unixSocket != "" {
213
+
if *force {
214
+
// If the socket file already exists then unlink it
215
+
_, err := os.Stat(*unixSocket)
216
+
if err == nil || !os.IsNotExist(err) {
217
+
err = syscall.Unlink(*unixSocket)
218
+
if err != nil {
219
+
log.Fatalf("Failed to unlink socket %s, error '%s'\n", *unixSocket, err)
220
+
}
221
+
}
222
+
}
223
+
212
224
unix, err = net.Listen("unix", *unixSocket)
213
225
if err != nil {
214
226
log.Fatalf("Could not open socket %s, error '%s'\n", *unixSocket, err)
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4