Skip to content

Commit cc3d0f6

Browse files
committed
getenv: treat a read error like eof
Otherwise, the following would occur: * settings.toml is in the process of being written by host computer * soft-reset begins * web workflow tries to grab CIRCUITPY_WIFI_SSID, but loops forever because FAT filesystem is in inconsistent state and file reads error * settings.toml write by host computer never completes and the filesystem remains corrupt * restarting yields a soft-bricked device, because startup reads CIRCUITPY_WIFI_SSID again
1 parent 4517071 commit cc3d0f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-module/os/getenv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ STATIC void close_file(file_arg *active_file) {
7272
// nothing
7373
}
7474
STATIC bool is_eof(file_arg *active_file) {
75-
return f_eof(active_file);
75+
return f_eof(active_file) | f_error(active_file);
7676
}
7777

7878
// Return 0 if there is no next character (EOF).

0 commit comments

Comments
 (0)