aboutsummaryrefslogtreecommitdiff
path: root/check-files.c
diff options
context:
space:
mode:
authorPetr Baudis <pasky@ucw.cz>2005-04-13 02:28:48 -0700
committerPetr Baudis <xpasky@machine>2005-04-13 02:28:48 -0700
commit2de381f919829aec1e35d6c7cc33519295dcd053 (patch)
tree3f703cd0cd32a4aa9892bda84c664c36e40f7921 /check-files.c
parentbdd4da595a265a091a859754a22688f7351cddee (diff)
downloadgit-2de381f919829aec1e35d6c7cc33519295dcd053.tar.gz
git-2de381f919829aec1e35d6c7cc33519295dcd053.tar.xz
[PATCH] Consolidate the error handling
Now there is error() for "library" errors and die() for fatal "application" errors. usage() is now used strictly only for usage errors. Signed-off-by: Petr Baudis <pasky@ucw.cz>
Diffstat (limited to 'check-files.c')
-rw-r--r--check-files.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/check-files.c b/check-files.c
index c74bf87d2..7d16691aa 100644
--- a/check-files.c
+++ b/check-files.c
@@ -18,22 +18,22 @@ static void check_file(const char *path)
/* Nonexistent is fine */
if (fd < 0) {
if (errno != ENOENT)
- usage("%s: %s", path, strerror(errno));
+ die("%s: %s", path, strerror(errno));
return;
}
/* Exists but is not in the cache is not fine */
pos = cache_name_pos(path, strlen(path));
if (pos < 0)
- usage("preparing to update existing file '%s' not in cache", path);
+ die("preparing to update existing file '%s' not in cache", path);
ce = active_cache[pos];
if (fstat(fd, &st) < 0)
- usage("fstat(%s): %s", path, strerror(errno));
+ die("fstat(%s): %s", path, strerror(errno));
changed = cache_match_stat(ce, &st);
if (changed)
- usage("preparing to update file '%s' not uptodate in cache", path);
+ die("preparing to update file '%s' not uptodate in cache", path);
}
int main(int argc, char **argv)