summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-07-22 17:20:34 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-07-22 17:20:34 -0400
commiteb6e8a6ca87879a6ca85788fcf6d3bf8848088e6 (patch)
tree3d9e4e493391dbf5749114ac9d9e2554fb4394f4
parent22b5d0b61995f07c89a7b6ad472024aa494b9a3c (diff)
oops
-rw-r--r--sd_daemon/listen_fds.go9
1 files 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