From db0efaeff1a3170cb89aef4107e902c3c0123a9c Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Sun, 7 Nov 2021 00:51:42 +0000 Subject: [PATCH] Drop redundant dirfd --- src/devices/file.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/devices/file.c b/src/devices/file.c index 0907092..3da3952 100644 --- a/src/devices/file.c +++ b/src/devices/file.c @@ -24,7 +24,6 @@ WITH REGARD TO THIS SOFTWARE. static FILE *f; static DIR *d; -static int dir_fd; static char *current_filename = ""; static enum { IDLE, FILE_READ, @@ -82,10 +81,9 @@ file_read(void *dest, Uint16 len) { if(state != FILE_READ && state != DIR_READ) { reset(); - if((d = opendir(current_filename)) != NULL) { + if((d = opendir(current_filename)) != NULL) state = DIR_READ; - dir_fd = dirfd(d); - } else if((f = fopen(current_filename, "rb")) != NULL) + else if((f = fopen(current_filename, "rb")) != NULL) state = FILE_READ; } if(state == FILE_READ)