Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uefi/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int _open(char* name, int flag, int mode)
{
long mode = 0;
long attributes = 0;
if(flag == O_WRONLY|O_CREAT|O_TRUNC)
if(flag == (O_WRONLY|O_CREAT|O_TRUNC))
{
mode = EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ;
}
Expand Down
9 changes: 9 additions & 0 deletions uefi/unistd.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,17 @@ char* strncpy(char* dest, char const* src, size_t count);
char* strncat(char* dest, char const* src, size_t count);
void* memcpy(void* dest, void const* src, size_t count);

FILE* fopen(char* filename, char* mode);
int fclose(FILE* stream);
int access(char* pathname, int mode)
{
int rval;
rval = fopen(pathname, 0);
if (rval == NULL)
{
return -1;
}
fclose(rval);
return 0;
}

Expand Down