[Pkg-wmaker-commits] [wmfire] 51/61: debian/patches: (fix_-Wunused-result.patch) Fix compiler warning.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Mon Aug 24 03:39:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmfire.

commit 406f3f8c35541b97feff98f7737746b1cc6b9af5
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Sat Jan 17 12:02:58 2015 -0600

    debian/patches: (fix_-Wunused-result.patch) Fix compiler warning.
---
 debian/patches/fix_-Wunused-result.patch | 18 ++++++++++++++++++
 debian/patches/series                    |  1 +
 2 files changed, 19 insertions(+)

diff --git a/debian/patches/fix_-Wunused-result.patch b/debian/patches/fix_-Wunused-result.patch
new file mode 100644
index 0000000..6759788
--- /dev/null
+++ b/debian/patches/fix_-Wunused-result.patch
@@ -0,0 +1,18 @@
+Description: Fix -Wunused-result compiler warning.
+ In particular, check if file given by -F option is empty.  If it is, print
+ a warning message.
+Author: Doug Torrance <dtorrance at monmouthcollege.edu>
+Last-Update: 2015-01-17
+
+--- a/src/wmfire.c
++++ b/src/wmfire.c
+@@ -365,7 +365,8 @@
+ 	/* First number only. Complex parsing should be done in */
+ 	/* external program and value saved to monitored file.  */
+ 
+-	fgets(buf, sizeof (buf), fp);
++	if (fgets(buf, sizeof (buf), fp) == NULL)
++		fprintf(stderr, "warning: file '%s' is empty\n", file_name);
+ 	number = atof(buf);
+ 	fclose(fp);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 9995de8..fce35eb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ rename_configure.patch
 update_autotools.patch
 fix_manpage.patch
 gdk_updates.patch
+fix_-Wunused-result.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmfire.git



More information about the Pkg-wmaker-commits mailing list