Non graceful error handling #2

Open
opened 2026-02-14 01:10:10 +00:00 by mikael-lovqvist · 0 comments

If a file descriptor is stale it just exits the entire application

fa2json/fs-watcher.c Lines 19 to 27 in 96f8ff2e98
if (parent_fd == -1) {
if (errno == ESTALE) {
fprintf(stderr, "File handle is no longer valid. File has been deleted\n");
return 0;
} else {
perror("open_by_handle_at");
exit(EXIT_FAILURE);
}
}

The proper behavior is to either skip the entry or make it a partial entry.

If a file descriptor is stale it just exits the entire application https://gitea.efforting.tech/mikael-lovqvist/fa2json/src/commit/96f8ff2e9872050a9c9c27bd0167c1a6f5bd2f89/fs-watcher.c#L19-L27 The proper behavior is to either skip the entry or make it a partial entry.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mikael-lovqvist/fa2json#2