docker/daemon_windows.go
8fb0ca2c
 // +build daemon
 
 package main
 
 import (
677a6b35
 	"fmt"
9ed4400b
 	"os"
677a6b35
 	"syscall"
9ed4400b
 
677a6b35
 	"github.com/Sirupsen/logrus"
8fb0ca2c
 	apiserver "github.com/docker/docker/api/server"
 	"github.com/docker/docker/daemon"
677a6b35
 	"github.com/docker/docker/pkg/mflag"
 	"github.com/docker/docker/pkg/system"
8fb0ca2c
 )
 
677a6b35
 var defaultDaemonConfigFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker" + string(os.PathSeparator) + "config" + string(os.PathSeparator) + "daemon.json"
 
351f6b8e
 func setPlatformServerConfig(serverConfig *apiserver.Config, daemonCfg *daemon.Config) *apiserver.Config {
8fb0ca2c
 	return serverConfig
 }
 
 // currentUserIsOwner checks whether the current user is the owner of the given
 // file.
 func currentUserIsOwner(f string) bool {
 	return false
 }
6578ad90
 
 // setDefaultUmask doesn't do anything on windows
 func setDefaultUmask() error {
 	return nil
 }
9ed4400b
 
 func getDaemonConfDir() string {
 	return os.Getenv("PROGRAMDATA") + `\docker\config`
 }
da982cf5
 
 // notifySystem sends a message to the host when the server is ready to be used
 func notifySystem() {
 }
677a6b35
 
 // setupConfigReloadTrap configures a Win32 event to reload the configuration.
 func setupConfigReloadTrap(configFile string, flags *mflag.FlagSet, reload func(*daemon.Config)) {
 	go func() {
 		sa := syscall.SecurityAttributes{
 			Length: 0,
 		}
 		ev := "Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid())
 		if h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 {
 			logrus.Debugf("Config reload - waiting signal at %s", ev)
 			for {
 				syscall.WaitForSingleObject(h, syscall.INFINITE)
 				daemon.ReloadConfiguration(configFile, flags, reload)
 			}
 		}
 	}()
 }