mirror of
https://github.com/fscotto/fsnap.git
synced 2026-11-26 03:09:51 +00:00
Unify error handling: output parameter, goto cleanup, errno preservation
- Replace global field variable with output parameter enum Fields *err - Adopt single goto cleanup pattern across all functions - Add errno preservation around cleanup in all modules - Fix early return bug in create.c cleanup block - Add ferror check in crc32() for silent read errors - Document error contracts in all public headers
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
#ifndef WALK_H
|
||||
#define WALK_H
|
||||
|
||||
typedef int(*WalkOp)(const char *, void *);
|
||||
typedef int (*WalkOp)(const char *, void *);
|
||||
|
||||
/* Recursively walk a directory, calling op for each entry.
|
||||
Returns 0 on success, -1 on failure. Silently skips directories
|
||||
where access is denied. */
|
||||
int walk(const char *directory, WalkOp op, void *context);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user