mirror of
https://github.com/fscotto/fsnap.git
synced 2026-11-26 03:09:51 +00:00
Name the parse-error status instead of repeating 128
The literal appeared in list.c and diff.c, was spelled out in prose in both their headers, and collided with an unrelated 128 in RecordObjectCompare, where it is an ordering sentinel for a NULL argument rather than a status. Introduce include/status.h with FSNAP_EPARSE, use it in both commands, and say in types.h that the value there means something else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KyCHPAxWzqa3vHKdXJkgx
This commit is contained in:
13
include/status.h
Normal file
13
include/status.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef STATUS_H
|
||||
#define STATUS_H
|
||||
|
||||
/* Command return values.
|
||||
|
||||
0 is success and -1 a system error, with errno set. FSNAP_EPARSE says the
|
||||
input itself was malformed, which is the snapshot's problem rather than the
|
||||
system's: errno carries nothing useful and the command has already written a
|
||||
snapshot:line: diagnostic to stderr. main maps every failure to
|
||||
EXIT_FAILURE, so the distinction is internal for now. */
|
||||
enum { FSNAP_EPARSE = 128 };
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user