MCPcopy Create free account
hub / github.com/plexdrive/plexdrive / checkOsSignals

Function checkOsSignals

main.go:237–249  ·  view source on GitHub ↗
(mountpoint string)

Source from the content-addressed store, hash-verified

235}
236
237func checkOsSignals(mountpoint string) {
238 signals := make(chan os.Signal, 1)
239 signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
240
241 go func() {
242 for sig := range signals {
243 Log.Infof("Received signal %v, stopping mount", sig)
244 if err := mount.Unmount(mountpoint, false); nil != err {
245 Log.Warningf("%v", err)
246 }
247 }
248 }()
249}
250
251func max(x, y int) int {
252 if x > y {

Callers 1

mainFunction · 0.85

Calls 1

UnmountFunction · 0.92

Tested by

no test coverage detected