mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
4785f1a7ab
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
20 lines
451 B
Go
20 lines
451 B
Go
// +build linux freebsd
|
|
|
|
package logger
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
"github.com/containerd/fifo"
|
|
"github.com/pkg/errors"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func openPluginStream(a *pluginAdapter) (io.WriteCloser, error) {
|
|
f, err := fifo.OpenFifo(context.Background(), a.fifoPath, unix.O_WRONLY|unix.O_CREAT|unix.O_NONBLOCK, 0700)
|
|
if err != nil {
|
|
return nil, errors.Wrapf(err, "error creating i/o pipe for log plugin: %s", a.Name())
|
|
}
|
|
return f, nil
|
|
}
|