diff options
| author | Alvar Penning <post@0x21.biz> | 2025-12-11 10:53:07 +0100 |
|---|---|---|
| committer | Alvar Penning <post@0x21.biz> | 2025-12-11 21:05:49 +0100 |
| commit | 6ce11bc44f5fe2344083a94175a1667ca02e016c (patch) | |
| tree | 15af65d7c9023b1cded0ca0976915d3130d5e519 /lib/utils_cmd.c | |
| parent | b27bf07ebf518a719482c5c40372549f5a9a127a (diff) | |
| download | monitoring-plugins-6ce11bc44f5fe2344083a94175a1667ca02e016c.tar.gz | |
lib/utils_cmd: Rename stdout, stderr in cmd_run_result
On OpenBSD's "stdio.h", stdin, stdout, and stderr are not directly
FILE*, but #defines. Thus, naming the output struct fields stdout and
stderr resulted in compiler errors, after replacing the #define.
https://codeberg.org/OpenBSD/src/src/commit/a762189c5efbb2811f3c853bc0e5578fd5fb919d/include/stdio.h#L75-L77
Diffstat (limited to 'lib/utils_cmd.c')
| -rw-r--r-- | lib/utils_cmd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c index 42c81793..23d42168 100644 --- a/lib/utils_cmd.c +++ b/lib/utils_cmd.c | |||
| @@ -489,14 +489,14 @@ cmd_run_result cmd_run2(const char *cmd_string, int flags) { | |||
| 489 | cmd_run_result result = { | 489 | cmd_run_result result = { |
| 490 | .cmd_error_code = 0, | 490 | .cmd_error_code = 0, |
| 491 | .error_code = 0, | 491 | .error_code = 0, |
| 492 | .stderr = | 492 | .err = |
| 493 | { | 493 | { |
| 494 | .buf = NULL, | 494 | .buf = NULL, |
| 495 | .buflen = 0, | 495 | .buflen = 0, |
| 496 | .line = NULL, | 496 | .line = NULL, |
| 497 | .lines = 0, | 497 | .lines = 0, |
| 498 | }, | 498 | }, |
| 499 | .stdout = | 499 | .out = |
| 500 | { | 500 | { |
| 501 | .buf = NULL, | 501 | .buf = NULL, |
| 502 | .buflen = 0, | 502 | .buflen = 0, |
| @@ -581,14 +581,14 @@ cmd_run_result cmd_run_array2(char *const *cmd, int flags) { | |||
| 581 | cmd_run_result result = { | 581 | cmd_run_result result = { |
| 582 | .cmd_error_code = 0, | 582 | .cmd_error_code = 0, |
| 583 | .error_code = 0, | 583 | .error_code = 0, |
| 584 | .stderr = | 584 | .err = |
| 585 | { | 585 | { |
| 586 | .buf = NULL, | 586 | .buf = NULL, |
| 587 | .buflen = 0, | 587 | .buflen = 0, |
| 588 | .line = NULL, | 588 | .line = NULL, |
| 589 | .lines = 0, | 589 | .lines = 0, |
| 590 | }, | 590 | }, |
| 591 | .stdout = | 591 | .out = |
| 592 | { | 592 | { |
| 593 | .buf = NULL, | 593 | .buf = NULL, |
| 594 | .buflen = 0, | 594 | .buflen = 0, |
| @@ -610,9 +610,9 @@ cmd_run_result cmd_run_array2(char *const *cmd, int flags) { | |||
| 610 | int pfd_err[2] = {cmd_open_result.stderr_pipe_fd[0], cmd_open_result.stderr_pipe_fd[1]}; | 610 | int pfd_err[2] = {cmd_open_result.stderr_pipe_fd[0], cmd_open_result.stderr_pipe_fd[1]}; |
| 611 | 611 | ||
| 612 | int_cmd_fetch_output2 tmp_stdout = _cmd_fetch_output2(pfd_out[0], flags); | 612 | int_cmd_fetch_output2 tmp_stdout = _cmd_fetch_output2(pfd_out[0], flags); |
| 613 | result.stdout = tmp_stdout.output_container; | 613 | result.out = tmp_stdout.output_container; |
| 614 | int_cmd_fetch_output2 tmp_stderr = _cmd_fetch_output2(pfd_err[0], flags); | 614 | int_cmd_fetch_output2 tmp_stderr = _cmd_fetch_output2(pfd_err[0], flags); |
| 615 | result.stderr = tmp_stderr.output_container; | 615 | result.err = tmp_stderr.output_container; |
| 616 | 616 | ||
| 617 | result.cmd_error_code = _cmd_close(file_descriptor); | 617 | result.cmd_error_code = _cmd_close(file_descriptor); |
| 618 | return result; | 618 | return result; |
