shared/subprocess/manager: Removes redundant error return value from NewProcessWithFds

It was always nil.

Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
This commit is contained in:
Thomas Parrott 2022-09-08 09:52:11 +01:00
parent ec1334d370
commit 47b3a00470

View File

@ -32,18 +32,14 @@ func NewProcess(name string, args []string, stdoutPath string, stderrPath string
}
}
p, err := NewProcessWithFds(name, args, nil, stdout, stderr)
if err != nil {
return nil, fmt.Errorf("Error when creating process object: %w", err)
}
p := NewProcessWithFds(name, args, nil, stdout, stderr)
p.closeFds = true
return p, nil
}
// NewProcessWithFds is a constructor for a process object. Represents a process with argument config. Returns an address to process.
func NewProcessWithFds(name string, args []string, stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser) (*Process, error) {
func NewProcessWithFds(name string, args []string, stdin io.ReadCloser, stdout io.WriteCloser, stderr io.WriteCloser) *Process {
proc := Process{
Name: name,
Args: args,
@ -52,7 +48,7 @@ func NewProcessWithFds(name string, args []string, stdin io.ReadCloser, stdout i
Stderr: stderr,
}
return &proc, nil
return &proc
}
// ImportProcess imports a saved process into a subprocess object.