Skip to contentSkip to conversation

Removed Warning from filecaps

PATCH In review Rishikesh K Rajak 2 participants 2 messages Mar 23, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Removed Warning from filecaps

These warning will appear when HAVE_LIBCAP is not defined.

c.c: In function ‘main’:
c.c:28: warning: unused variable ‘ret’
c.c:27: warning: unused variable ‘caps2’
c.c:27: warning: unused variable ‘caps’

Signed-off By: Rishikesh K Rajak<[email protected]>
---

testcases/kernel/security/filecaps/c.c +2 -1
index ee6cf05..5e1696c 100644
@@ -24,10 +24,11 @@
 
 int main()
 {
+
+#ifdef HAVE_LIBCAP
        cap_t caps, caps2;
        int ret;
 
-#ifdef HAVE_LIBCAP
        caps = cap_from_text("cap_setpcap+ep");
        caps2 = cap_from_text("cap_setpcap+ep");
        ret = cap_set_proc(caps);
Signature · 16 lines
Thanks & Regards
Rishi
LTP Maintainer
IBM, LTC, Bangalore
Please join IRC #ltp @ irc.freenode.net

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Rishikesh K Rajak

These warning will appear when HAVE_LIBCAP is not defined.

c.c: In function ‘main’:
c.c:28: warning: unused variable ‘ret’
c.c:27: warning: unused variable ‘caps2’
c.c:27: warning: unused variable ‘caps’

Signed-off By: Rishikesh K Rajak<[email protected]>
---

testcases/kernel/security/filecaps/c.c +0 -0
index ee6cf05..5e1696c 100644
@@ -24,10 +24,11 @@
 
  int main()

testcases/kernel/security/filecaps/c.c line 34

Quoted 10 lines
testcases/kernel/security/filecaps/c.c +2 -1
  {
+
+#ifdef HAVE_LIBCAP
        cap_t caps, caps2;
        int ret;
 
-#ifdef HAVE_LIBCAP
        caps = cap_from_text("cap_setpcap+ep");
        caps2 = cap_from_text("cap_setpcap+ep");
        ret = cap_set_proc(caps);

This is better because it also avoids compilation failures when libcap isn't present. The conditional around sys/capability.h should be restored as well.

Thanks,
-Garrett

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list