all repos — st @ 20d53cebc122829449524ef339ce44e13c6e85ec

st (suckless terminal) config

dup() -> dup2()

gcc would warn about an unused result. We know it is 0 and dup()
can't fail in these circumstances, as we closed fd0 previously.
Using dup2() to do the same saves one line and shuts gcc up, bringing
us a clean build back.
FRIGN dev@frign.de
commit

20d53cebc122829449524ef339ce44e13c6e85ec

parent

bf8c71e42937b623f76ced22c9557f87e3d945da

1 files changed, 1 insertions(+), 2 deletions(-)

jump to
M st.cst.c

@@ -1430,8 +1430,7 @@

if (opt_line) { if ((cmdfd = open(opt_line, O_RDWR)) < 0) die("open line failed: %s\n", strerror(errno)); - close(0); - dup(cmdfd); + dup2(cmdfd, 0); stty(); return; }