Final bit of compiling on Windows

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard
2016-02-25 19:42:37 -08:00
parent cc6ba36498
commit dd192f4cd9
7 changed files with 361 additions and 269 deletions

View File

@@ -4,10 +4,8 @@ import (
"log"
"net"
"os"
"os/signal"
"runtime"
"sync"
"syscall"
"time"
"google.golang.org/grpc"
@@ -92,22 +90,6 @@ func main() {
}
}
func checkLimits() error {
var l syscall.Rlimit
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &l); err != nil {
return err
}
if l.Cur <= minRlimit {
logrus.WithFields(logrus.Fields{
"current": l.Cur,
"max": l.Max,
}).Warn("containerd: low RLIMIT_NOFILE changing to max")
l.Cur = l.Max
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &l)
}
return nil
}
func debugMetrics(interval time.Duration, graphiteAddr string) error {
for name, m := range supervisor.Metrics() {
if err := metrics.DefaultRegistry.Register(name, m); err != nil {
@@ -191,19 +173,6 @@ func daemon(address, stateDir string, concurrency int, oom bool) error {
return s.Serve(l)
}
func reapProcesses() {
s := make(chan os.Signal, 2048)
signal.Notify(s, syscall.SIGCHLD)
if err := osutils.SetSubreaper(1); err != nil {
logrus.WithField("error", err).Error("containerd: set subpreaper")
}
for range s {
if _, err := osutils.Reap(); err != nil {
logrus.WithField("error", err).Error("containerd: reap child processes")
}
}
}
// getDefaultID returns the hostname for the instance host
func getDefaultID() string {
hostname, err := os.Hostname()