[Pkg-wmaker-commits] [wmsysmon] 29/37: debian/patches/unused-{but-set-variable,result}.patch: New patches; fix compiler warnings.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Tue Aug 25 03:09:48 UTC 2015


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

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

commit ae681903af6055532013770ba59b794948b637c7
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Sun Jul 12 11:50:14 2015 -0600

    debian/patches/unused-{but-set-variable,result}.patch: New patches; fix
    compiler warnings.
---
 debian/patches/series                        |  2 ++
 debian/patches/unused-but-set-variable.patch | 18 ++++++++++++++++++
 debian/patches/unused-result.patch           | 16 ++++++++++++++++
 3 files changed, 36 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index ca0f577..5f3018d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,5 @@
 02-output.patch
 03-src_makefile.patch
 04-makefile-strip.patch
+unused-but-set-variable.patch
+unused-result.patch
diff --git a/debian/patches/unused-but-set-variable.patch b/debian/patches/unused-but-set-variable.patch
new file mode 100644
index 0000000..a6573d0
--- /dev/null
+++ b/debian/patches/unused-but-set-variable.patch
@@ -0,0 +1,18 @@
+Description: Fix "variable ‘stage’ set but not used" compiler warning.
+Author: Doug Torrance <dtorrance at monmouthcollege.edu>
+Last-Update: 2015-07-12
+
+--- a/src/wmsysmon.c
++++ b/src/wmsysmon.c
+@@ -439,10 +439,9 @@
+ 	static long	swapins;
+ 	static long	swapouts;
+ 	static long	intdiff;
+-	static long	stage;
+ 	static long	*tints;
+ 
+-	stage = io = iodiff = iopercent = pageins = pageouts = swapins = swapouts = 0;
++	io = iodiff = iopercent = pageins = pageouts = swapins = swapouts = 0;
+ 
+ 	statfp = freopen("/proc/stat", "r", statfp);
+ 
diff --git a/debian/patches/unused-result.patch b/debian/patches/unused-result.patch
new file mode 100644
index 0000000..045f431
--- /dev/null
+++ b/debian/patches/unused-result.patch
@@ -0,0 +1,16 @@
+Description: Fix "ignoring return value of ‘fscanf’" compiler warning.
+Author: Doug Torrance <dtorrance at monmouthcollege.edu>
+Last-Update: 2015-07-12
+
+--- a/src/wmsysmon.c
++++ b/src/wmsysmon.c
+@@ -233,7 +233,8 @@
+     /* init uptime */
+ 	fp = fopen("/proc/uptime", "r");
+ 	if (fp) {
+-		fscanf(fp, "%ld", &start_time);
++		if (fscanf(fp, "%ld", &start_time) < 1)
++			fprintf(stderr, "warning: could not read uptime\n");
+ 		fclose(fp);
+ 		start_uptime = time(NULL);
+ 	}

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



More information about the Pkg-wmaker-commits mailing list