mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 19:08:55 +00:00
Remove background checking code
This commit is contained in:
parent
0e78ac92d8
commit
1449d7dc29
@ -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
|
|
||||||
}
|
|
@ -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()
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user