[hackers] [st] Make build shut up about system() without return value check. || alp_AT_alexpilon.ca

From: <git_AT_suckless.org>
Date: Mon, 27 Apr 2015 12:22:36 +0200 (CEST)

commit 742a41d6554ce1848f45ea89cb83d62c7e881352
Author: alp_AT_alexpilon.ca <alp_AT_alexpilon.ca>
Date: Tue Apr 21 16:27:51 2015 +0200

    Make build shut up about system() without return value check.
    
        st.c:1321:2: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result]
                system(cmd);
                ^~~~~~ ~~~
    
    Debatable whether an error here should case exit(EXIT_FAILURE). Just
    preserving the existing behaviour for now.

diff --git a/st.c b/st.c
index 8e51344..b042be2 100644
--- a/st.c
+++ b/st.c
_AT_@ -1276,7 +1276,8 @@ stty(void)
                 siz-= n + 1;
         }
         *q = '\0';
- system(cmd);
+ if (system(cmd) != 0)
+ perror("Couldn't call stty");
 }
 
 void
Received on Mon Apr 27 2015 - 12:22:36 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 27 2015 - 12:24:12 CEST