Put the constant on the left hand side to avoid accidental assignment if an "=" is omitted (#67).

This commit is contained in:
Andrew Wood
2026-03-20 22:14:35 +00:00
parent 149be3f9ab
commit 09a55ef62a
+2 -2
View File
@@ -342,7 +342,7 @@ static int pv__monitor(pvstate_t state, opts_t opts)
pipefd_out[1] = -1;
/* Pipe for the input side of the command, if we're monitoring it. */
if ((opts->side == PV_SIDE_IN) || (opts->side == PV_SIDE_BOTH)) {
if ((PV_SIDE_IN == opts->side) || (PV_SIDE_BOTH == opts->side)) {
if (0 != pipe(pipefd_in)) {
fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno));
return PV_ERROREXIT_MONITOR;
@@ -350,7 +350,7 @@ static int pv__monitor(pvstate_t state, opts_t opts)
}
/* Pipe for the output side of the command, if we're monitoring it. */
if ((opts->side == PV_SIDE_OUT) || (opts->side == PV_SIDE_BOTH)) {
if ((PV_SIDE_OUT == opts->side) || (PV_SIDE_BOTH == opts->side)) {
if (0 != pipe(pipefd_out)) {
fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno));
if (-1 != pipefd_in[0])