aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFRIGN <dev@frign.de>2015-09-22 13:13:25 +0200
committerFRIGN <dev@frign.de>2015-09-22 14:15:24 +0200
commit20d53cebc122829449524ef339ce44e13c6e85ec (patch)
tree5059811bdd2f953b8ed8ead80fcf300689c60ea9
parentbf8c71e42937b623f76ced22c9557f87e3d945da (diff)
downloadst-patched-20d53cebc122829449524ef339ce44e13c6e85ec.tar.bz2
st-patched-20d53cebc122829449524ef339ce44e13c6e85ec.tar.xz
st-patched-20d53cebc122829449524ef339ce44e13c6e85ec.zip
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.
-rw-r--r--st.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/st.c b/st.c
index bd8b815..bcf74b3 100644
--- a/st.c
+++ b/st.c
@@ -1430,8 +1430,7 @@ ttynew(void)
1430 if (opt_line) { 1430 if (opt_line) {
1431 if ((cmdfd = open(opt_line, O_RDWR)) < 0) 1431 if ((cmdfd = open(opt_line, O_RDWR)) < 0)
1432 die("open line failed: %s\n", strerror(errno)); 1432 die("open line failed: %s\n", strerror(errno));
1433 close(0); 1433 dup2(cmdfd, 0);
1434 dup(cmdfd);
1435 stty(); 1434 stty();
1436 return; 1435 return;
1437 } 1436 }