mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 07:15:59 +01:00
Allow simpler stdout -f handling.
This commit is contained in:
parent
f2da43a0b6
commit
a1cd28f809
1 changed files with 9 additions and 3 deletions
12
st.c
12
st.c
|
@ -801,9 +801,15 @@ ttynew(void) {
|
||||||
close(s);
|
close(s);
|
||||||
cmdfd = m;
|
cmdfd = m;
|
||||||
signal(SIGCHLD, sigchld);
|
signal(SIGCHLD, sigchld);
|
||||||
if(opt_io && !(fileio = fopen(opt_io, "w"))) {
|
if(opt_io) {
|
||||||
fprintf(stderr, "Error opening %s:%s\n",
|
if(!strcmp(opt_io, "-")) {
|
||||||
opt_io, strerror(errno));
|
fileio = stdout;
|
||||||
|
} else {
|
||||||
|
if(!(fileio = fopen(opt_io, "w"))) {
|
||||||
|
fprintf(stderr, "Error opening %s:%s\n",
|
||||||
|
opt_io, strerror(errno));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue