From eb6e8a6ca87879a6ca85788fcf6d3bf8848088e6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 22 Jul 2016 17:20:34 -0400 Subject: oops --- sd_daemon/listen_fds.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sd_daemon/listen_fds.go b/sd_daemon/listen_fds.go index 51433d9..434f7cc 100644 --- a/sd_daemon/listen_fds.go +++ b/sd_daemon/listen_fds.go @@ -1,5 +1,5 @@ // Copyright 2015 CoreOS, Inc. -// Copyright 2015, 2016 Luke Shumaker +// Copyright 2015-2016 Luke Shumaker // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -57,13 +57,14 @@ func ListenFds(unsetEnv bool) []*os.File { names := strings.Split(os.Getenv("LISTEN_FDNAMES"), ":") files := make([]*os.File, 0, nfds) - for i = 0; i < nfds; i++ { + for i := 0; i < nfds; i++ { + fd := i+C.SD_LISTEN_FDS_START syscall.CloseOnExec(fd) - name = "unknown" + name := "unknown" if i < len(names) { name = names[i] } - files = append(files, os.NewFile(uintptr(i+C.SD_LISTEN_FDS_START), name)) + files = append(files, os.NewFile(uintptr(fd), name)) } return files -- cgit v1.2.3