aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-03-04 19:11:37 -0500
committerB. Watson <urchlay@slackware.uk>2025-03-04 19:11:37 -0500
commit848156d71edf0fef3fb34cb2aa31571068a45d2d (patch)
tree0380744c7879ba83231ecaf13c29ee2781215698
parent4f48e0900084945f687ea0cb7643a7fcd84690ae (diff)
downloadbw-atari8-tools-848156d71edf0fef3fb34cb2aa31571068a45d2d.tar.gz
listamsb: tweak popen() stuff.
-rw-r--r--listamsb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/listamsb.c b/listamsb.c
index 281e075..5071dc0 100644
--- a/listamsb.c
+++ b/listamsb.c
@@ -588,11 +588,11 @@ void open_output() {
verbose(1, "using stdout for output");
} else {
verbose(1, "using pipe for output: %s", pipe_command);
- outfile = popen(pipe_command, "w");
- if(!outfile) {
- perror(pipe_command);
- exit(1);
- }
+ outfile = popen(pipe_command, "w"); /* "wb" not allowed! */
+ /* we probably never see this error. popen() fails only is
+ we feed it an invalid mode, or if fork() or pipe() fails.
+ all other errors are caught at pclose(). */
+ if(!outfile) os_err("|%s: %s", pipe_command, strerror(errno));
need_pclose = 1;
}
}