mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Fix regression test build warnings
This commit is contained in:
parent
ddbf6c24bb
commit
aa05cbdd1e
2 changed files with 10 additions and 10 deletions
|
@ -23,8 +23,6 @@
|
|||
#define FALSE 0
|
||||
#define TRUE !FALSE
|
||||
|
||||
#define max(x,y) (x) > (y) ? (x) : (y)
|
||||
|
||||
#define MAX_FILES 5
|
||||
|
||||
int (*pass)[MAX_FILES];
|
||||
|
@ -60,7 +58,12 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
num_files = max(argc - 1, MAX_FILES);
|
||||
num_files = argc - 1;
|
||||
if (num_files > MAX_FILES) {
|
||||
fprintf(stderr, "ERROR: a maximum of %d files is supported\n",
|
||||
MAX_FILES);
|
||||
return 1;
|
||||
}
|
||||
|
||||
shmid = shmget(IPC_PRIVATE, sizeof(int[2][MAX_FILES]), IPC_CREAT);
|
||||
if (shmid == -1) {
|
||||
|
@ -81,11 +84,11 @@ int main(int argc, char *argv[])
|
|||
int status;
|
||||
int allpassed = TRUE;
|
||||
|
||||
test_files(argc - 1, &argv[1], 0);
|
||||
test_files(num_files, &argv[1], 0);
|
||||
|
||||
while (wait(&status) != pid) ;
|
||||
|
||||
for (i = 0; i < argc - 1; i++) {
|
||||
for (i = 0; i < num_files; i++) {
|
||||
if (pass[0][i] != pass[1][i] ||
|
||||
pass[0][i] == -1 || pass[1][i] == -1) {
|
||||
if (allpassed) {
|
||||
|
@ -108,7 +111,7 @@ int main(int argc, char *argv[])
|
|||
shmctl(shmid, IPC_RMID, &shm_desc);
|
||||
|
||||
} else {
|
||||
test_files(argc - 1, &argv[1], 1);
|
||||
test_files(num_files, &argv[1], 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
int main (int argc, char * argv[]) {
|
||||
int sock, in_sock, fd;
|
||||
struct sockaddr_un local, remote;
|
||||
int len, exec_now, pfd_ret;
|
||||
int len, pfd_ret;
|
||||
socklen_t len2;
|
||||
char comparison_buffer[17];
|
||||
char inbound_buffer[17];
|
||||
|
@ -40,9 +40,6 @@ int main (int argc, char * argv[]) {
|
|||
struct cmsghdr *ctrl_mesg;
|
||||
struct pollfd pfd;
|
||||
|
||||
|
||||
exec_now = 0;
|
||||
|
||||
if (argc < 4 || argc > 5 || (argc == 5 && (strcmp(argv[4], "delete_file") != 0))) {
|
||||
fprintf(stderr, "Usage: %s <file>\n", argv[0]);
|
||||
return(1);
|
||||
|
|
Loading…
Add table
Reference in a new issue