From 1449d7dc29eae36954c1190f57004a1f2b35e09f Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 28 Apr 2018 14:36:24 +0200 Subject: [PATCH] Remove background checking code --- cmd/restic/background.go | 9 --------- cmd/restic/background_linux.go | 21 --------------------- 2 files changed, 30 deletions(-) delete mode 100644 cmd/restic/background.go delete mode 100644 cmd/restic/background_linux.go diff --git a/cmd/restic/background.go b/cmd/restic/background.go deleted file mode 100644 index 2f115adfd..000000000 --- a/cmd/restic/background.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !linux - -package main - -// IsProcessBackground should return true if it is running in the background or false if not -func IsProcessBackground() bool { - //TODO: Check if the process are running in the background in other OS than linux - return false -} diff --git a/cmd/restic/background_linux.go b/cmd/restic/background_linux.go deleted file mode 100644 index b9a2a2f00..000000000 --- a/cmd/restic/background_linux.go +++ /dev/null @@ -1,21 +0,0 @@ -package main - -import ( - "syscall" - "unsafe" - - "github.com/restic/restic/internal/debug" -) - -// IsProcessBackground returns true if it is running in the background or false if not -func IsProcessBackground() bool { - var pid int - _, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(syscall.Stdin), syscall.TIOCGPGRP, uintptr(unsafe.Pointer(&pid))) - - if err != 0 { - debug.Log("Can't check if we are in the background. Using default behaviour. Error: %s\n", err.Error()) - return false - } - - return pid != syscall.Getpgrp() -}