2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

Remove background checking code

This commit is contained in:
Alexander Neumann 2018-04-28 14:36:24 +02:00
parent 0e78ac92d8
commit 1449d7dc29
2 changed files with 0 additions and 30 deletions

View File

@ -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
}

View File

@ -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()
}