Skip to content

Commit

Permalink
fix(aostdio): return fread bytes read from weavedrive_read
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotsayes committed Dec 12, 2024
1 parent 00fdb7a commit a23b188
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dev-cli/container/src/aolibc/aostdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ FILE* fopen(const char* filename, const char* mode) {
}

size_t fread(void* ptr, size_t size, size_t nmemb, FILE* stream) {
AO_LOG( "AO: fread called\n");
int fd = fileno(stream);
weavedrive_read(fd, ptr, size * nmemb);
return nmemb;
int bytes_read = weavedrive_read(fd, ptr, size * nmemb);
AO_LOG( "AO: weavedrive_read returned %d bytes\n", bytes_read);
return bytes_read;
}

int fclose(FILE* stream) {
Expand Down

0 comments on commit a23b188

Please sign in to comment.