<commit_before>// Copyright 2015 <NAME>. All rights reserved.
// Use of this source code is governed by the standard MIT License (MIT)
// that can be found in the LICENSE file.

// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris

package lockfile

import (
	"os"
)

// ProcessRunning is a cross-platform check to work on both Windows and Unix systems as the os.FindProcess() function works differently.
func ProcessRunning(pid int) bool {
	p, _ := os.FindProcess(pid)   // On unix the FindProcess never returns an error
	err := p.Signal(os.Interrupt) // Returns error if process is not running
	return err == nil
}<commit_msg>ProcessRunning terminated the other process when it shouldn’t on unix systems<commit_after>// Copyright 2015 <NAME>. All rights reserved.
// Use of this source code is governed by the standard MIT License (MIT)
// that can be found in the LICENSE file.

// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris

package lockfile

import (
	"os"
	"syscall"
)

// ProcessRunning is a cross-platform check to work on both Windows and Unix systems as the os.FindProcess() function works differently.
func ProcessRunning(pid int) bool {
	p, _ := os.FindProcess(pid)   // On unix the FindProcess never returns an error
	err := p.Signal(syscall.Signal(0)) // Returns error if process is not running
	return err == nil
}
{'fraction_non_alphanumeric': 0.07967836257309942, 'fraction_numerical': 0.006578947368421052, 'mean_word_length': 3.9422382671480145, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4178642', 'n_tokens_mistral': 396, 'n_tokens_neox': 371, 'n_words': 183}