diff options
author | Dave Davenport <qball@gmpclient.org> | 2015-02-01 15:12:29 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2015-02-01 15:12:29 +0100 |
commit | 5d4ab2e6266cce32fc39f228bb8f059596c06482 (patch) | |
tree | 7b97467608c89b5de1fcce021a57d86019623b7a | |
parent | 1156c19cbf1591e38a6cedabb52fc9dee2541cd1 (diff) |
Always compile with Extra warnings.
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | source/rofi.c | 10 |
3 files changed, 7 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am index 55dd561c..a55dd526 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,6 +11,7 @@ LIBS=\ @pango_LIBS@ AM_CFLAGS=\ + @EXTRA_CFLAGS@\ @xft_CFLAGS@\ @x11_CFLAGS@\ @xinerama_CFLAGS@\ diff --git a/configure.ac b/configure.ac index 6ca4e75a..9c87ce22 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,7 @@ PKG_CHECK_MODULES([x11], [x11]) PKG_CHECK_MODULES([xinerama], [xinerama]) PKG_CHECK_MODULES([pango], [pango pangoxft]) +AC_SUBST([EXTRA_CFLAGS], ["-Wall -Wextra"]) AC_CONFIG_FILES([Makefile ]) AC_OUTPUT diff --git a/source/rofi.c b/source/rofi.c index c71eab60..d2a169a6 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -2750,7 +2750,10 @@ static void create_pid_file ( const char *pidfile ) // Write pid, not needed, but for completeness sake. char buffer[64]; int length = snprintf ( buffer, 64, "%i", getpid () ); - ssize_t l = write ( fd, buffer, length ); + ssize_t l = 0; + while ( l < length ) { + l += write ( fd, &buffer[l], length - l ); + } } } @@ -2918,10 +2921,7 @@ int main ( int argc, char *argv[] ) // Setup handler for sighub (reload config) const struct sigaction hup_action = { - .sa_handler = hup_action_handler, - .sa_mask = 0, - .sa_flags = 0, - .sa_restorer = NULL + .sa_handler = hup_action_handler }; sigaction ( SIGHUP, &hup_action, NULL ); |