Skip to content

Commit

Permalink
Fix all compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
topjohnwu committed Mar 26, 2017
1 parent d7c6efa commit d2f80c3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions libselinux/src/booleans.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ int security_get_boolean_names(char ***names, int *len)
}

for (i = 0; i < *len; i++) {
n[i] = (char *)malloc(_D_ALLOC_NAMLEN(namelist[i]));
n[i] = strdup(namelist[i]->d_name);
if (!n[i]) {
rc = -1;
goto bad_freen;
}
strcpy(n[i], namelist[i]->d_name);
}
rc = 0;
*names = n;
Expand Down
2 changes: 1 addition & 1 deletion libselinux/src/load_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int selinux_mkload_policy(int preservebools)
* values across a reload, so we do not need to
* preserve them in userspace.
*/
if (preservebools && uname(&uts) == 0 && strverscmp(uts.release, "2.6.22") >= 0)
if (preservebools && uname(&uts) == 0)
preservebools = 0;

if (usesepol) {
Expand Down
1 change: 1 addition & 0 deletions libselinux/src/setrans_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/uio.h>

#include <errno.h>
#include <stdlib.h>
Expand Down
4 changes: 2 additions & 2 deletions libsepol/src/genusers.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ static int load_users(struct policydb *policydb, const char *path)
{
FILE *fp;
char *buffer = NULL, *p, *q, oldc;
size_t len = 0;
ssize_t nread;
ssize_t nread = 0;
unsigned lineno = 0, islist = 0, bit;
user_datum_t *usrdatum;
role_datum_t *roldatum;
Expand All @@ -55,6 +54,7 @@ static int load_users(struct policydb *policydb, const char *path)

while(fgets(buffer, 255, fp) != NULL) {
#else
size_t len = 0;
__fsetlocking(fp, FSETLOCKING_BYCALLER);
while ((nread = getline(&buffer, &len, fp)) > 0) {
#endif
Expand Down

0 comments on commit d2f80c3

Please sign in to comment.