created & implemented OPENDIR

This commit is contained in:
Václav Šmejkal 2023-02-05 18:21:00 +01:00
parent f4d30f1aa2
commit d0aea64acc
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -10,6 +10,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <dirent.h>
#include <why2/flags.h> #include <why2/flags.h>
@ -18,7 +19,8 @@ enum POINTER_TYPES
{ {
ALLOCATION, ALLOCATION,
FOPEN, FOPEN,
OPEN OPEN,
OPENDIR
}; };
typedef struct node typedef struct node
@ -160,6 +162,10 @@ void why2_free(void *pointer)
case OPEN: //OPEN SYSTEM CALL case OPEN: //OPEN SYSTEM CALL
close(*((int*) pointer)); close(*((int*) pointer));
break; break;
case OPENDIR: //OPENDIR SYSTEM CALL
closedir(pointer);
break;
} }
} }