Commit Graph

5 Commits

Author SHA1 Message Date
Nicolas Iooss
679accae37 Add missing explicit cast in libqpol/policy.c
libqpol/policy.c:650:36: warning: passing argument 2 of
    'qpol_type_get_isattr' from incompatible pointer type
       if (qpol_type_get_isattr(policy, attr, &isattr)) {
                                        ^
    libqpol/include/qpol/type_query.h:96:13: note: expected 'const
    struct qpol_type_t *' but argument is of type 'struct type_datum_t
    *'
      extern int qpol_type_get_isattr(const qpol_policy_t * policy, const qpol_type_t * datum, unsigned char *isattr);
                 ^
2014-11-02 13:02:57 -05:00
Nicolas Iooss
1a02a86836 Include sys/stat.h in libqpol/policy.c for fstat
The declaration of fstat was missing.  "gcc -Wall" reported:

  libqpol/policy.c: In function 'qpol_policy_open_from_file_opt':
  libqpol/policy.c:1060:3: warning: implicit declaration of function
  'fstat' [-Wimplicit-function-declaration]
     if (fstat(fd, &sb) < 0) {
     ^
2014-11-02 13:02:11 -05:00
Nicolas Iooss
ee7064a711 Add printf format attribute to relevant functions in libqpol
"gcc -Wformat" needs printing functions to be marked with a format
attribute to be able to work.  Add this attribute to some functions in
libqpol, found with "gcc -Werror=missing-format-attribute"

gcc documentation about format attribute:
https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
2014-11-02 13:02:11 -05:00
Nicolas Iooss
7aace4d52a Remove unused variables in libqpol 2014-11-02 13:02:10 -05:00
Chris PeBenito
8363f8edf7 Import libqpol from setools3.
Break setools3 dependence. Also fix SWIG wrapper to work with SWIG 2.x.
2014-10-24 21:00:24 -04:00