[Pkg-wmaker-commits] [wmmemload] 77/103: debian/patches: (fix-unused-result.patch) Fix compiler warning.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 03:11:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmmemload.
commit 277930ec32a242a73bd8dd71d2e8050d2a3fd455
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Fri Oct 10 08:45:57 2014 -0500
debian/patches: (fix-unused-result.patch) Fix compiler warning.
---
debian/patches/fix-unused-result.patch | 49 ++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 50 insertions(+)
diff --git a/debian/patches/fix-unused-result.patch b/debian/patches/fix-unused-result.patch
new file mode 100644
index 0000000..556c4b8
--- /dev/null
+++ b/debian/patches/fix-unused-result.patch
@@ -0,0 +1,49 @@
+Description: Fix unused result compiler warning.
+ Fix the following compiler warnings, which appear when -D_FORTIFY_SOURCE=2 is
+ passed to gcc:
+ .
+ mem_freebsd.c: In function ‘mem_init’:
+ mem_freebsd.c:38:2: warning: ignoring return value of ‘seteuid’, declared with
+ attribute warn_unused_result [-Wunused-result]
+ seteuid(getuid());
+ ^
+ mem_freebsd.c:39:2: warning: ignoring return value of ‘setegid’, declared with
+ attribute warn_unused_result [-Wunused-result]
+ setegid(getgid());
+ ^
+Author: Doug Torrance <dtorrance at monmouthcollege.edu>
+Last-Update: 2014-10-10
+
+--- a/src/mem_freebsd.c
++++ b/src/mem_freebsd.c
+@@ -27,6 +27,8 @@
+ /* initialize function */
+ void mem_init(void)
+ {
++ int s;
++
+ kvm_data = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");
+
+ if (kvm_data == NULL) {
+@@ -35,8 +37,19 @@
+ }
+
+ /* drop setgid & setuid (the latter should not be there really) */
+- seteuid(getuid());
+- setegid(getgid());
++ s = seteuid(getuid());
++ if (s == -1) {
++ fprintf(stderr, "seteuid(getuid()) failed: %s\n",
++ strerror(errno));
++ exit(1);
++ }
++
++ s = setegid(getgid());
++ if (s == -1) {
++ fprintf(stderr, "setegid(getgid()) failed: %s\n",
++ strerror(errno));
++ exit(1);
++ }
+
+ if (geteuid() != getuid() || getegid() != getgid()) {
+ fprintf(stderr, "unable to drop privileges");
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..3609eb9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-unused-result.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmmemload.git
More information about the Pkg-wmaker-commits
mailing list