Removed Warning from filecaps
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
@@ -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® 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
Quoted 16 lines · Rishikesh K Rajak
These warning will appear when
HAVE_LIBCAPis 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@@ -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® 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