fix windows signal

This commit is contained in:
Alireza Ahmadi
2026-02-20 01:31:33 +01:00
parent 5b6daf9e70
commit 322a74429d
4 changed files with 14 additions and 2 deletions

View File

@@ -4,9 +4,13 @@
package sys
import (
"syscall"
"github.com/shirou/gopsutil/v4/net"
)
var SIGUSR1 = syscall.SIGUSR1
func GetTCPCount() (int, error) {
stats, err := net.Connections("tcp")
if err != nil {

View File

@@ -8,8 +8,11 @@ import (
"fmt"
"io"
"os"
"syscall"
)
var SIGUSR1 = syscall.SIGUSR1
func getLinesNum(filename string) (int, error) {
file, err := os.Open(filename)
if err != nil {

View File

@@ -4,9 +4,13 @@
package sys
import (
"syscall"
"github.com/shirou/gopsutil/v4/net"
)
var SIGUSR1 = syscall.Signal(0)
func GetTCPCount() (int, error) {
stats, err := net.Connections("tcp")
if err != nil {