github.com/cptmikhailov/conmon@v2.0.20+incompatible/cmd/conmon-config/conmon-config.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"io/ioutil"
     6  
     7  	"github.com/containers/conmon/runner/config"
     8  )
     9  
    10  func main() {
    11  	output := `
    12  #if !defined(CONFIG_H)
    13  #define CONFIG_H
    14  
    15  #define BUF_SIZE %d
    16  #define STDIO_BUF_SIZE %d
    17  #define CONN_SOCK_BUF_SIZE %d
    18  #define DEFAULT_SOCKET_PATH "%s"
    19  #define WIN_RESIZE_EVENT %d
    20  #define REOPEN_LOGS_EVENT %d
    21  #define TIMED_OUT_MESSAGE "%s"
    22  
    23  #endif // CONFIG_H
    24  `
    25  	if err := ioutil.WriteFile("config.h", []byte(fmt.Sprintf(
    26  		output,
    27  		config.BufSize,
    28  		config.BufSize,
    29  		config.ConnSockBufSize,
    30  		config.ContainerAttachSocketDir,
    31  		config.WinResizeEvent,
    32  		config.ReopenLogsEvent,
    33  		config.TimedOutMessage)),
    34  		0644); err != nil {
    35  		fmt.Errorf(err.Error())
    36  	}
    37  }