remove a pointless error code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/include/got_error.h b/include/got_error.h
index 3c5386e..ca9b003 100644
--- a/include/got_error.h
+++ b/include/got_error.h
@@ -28,7 +28,7 @@
#define GOT_ERR_BAD_OBJ_HDR 10
#define GOT_ERR_OBJ_TYPE 11
#define GOT_ERR_BAD_OBJ_DATA 12
-#define GOT_ERR_FILE_OPEN 13
+/* 13 is currently free for re-use */
#define GOT_ERR_BAD_PACKIDX 14
#define GOT_ERR_PACKIDX_CSUM 15
#define GOT_ERR_BAD_PACKFILE 16
@@ -92,7 +92,7 @@ static const struct got_error {
{ GOT_ERR_BAD_OBJ_HDR, "bad object header" },
{ GOT_ERR_OBJ_TYPE, "wrong type of object" },
{ GOT_ERR_BAD_OBJ_DATA, "bad object data" },
- { GOT_ERR_FILE_OPEN, "could not open file" },
+ { 13, "unused error code" },
{ GOT_ERR_BAD_PACKIDX, "bad pack index file" },
{ GOT_ERR_PACKIDX_CSUM, "pack index file checksum error" },
{ GOT_ERR_BAD_PACKFILE, "bad pack file" },
diff --git a/lib/diff.c b/lib/diff.c
index a3da580..cefba42 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -54,7 +54,7 @@ diff_blobs(struct got_blob_object *blob1, struct got_blob_object *blob2,
if (blob1) {
f1 = got_opentemp();
if (f1 == NULL)
- return got_error(GOT_ERR_FILE_OPEN);
+ return got_error_from_errno();
} else
flags |= D_EMPTY1;
@@ -62,7 +62,7 @@ diff_blobs(struct got_blob_object *blob1, struct got_blob_object *blob2,
f2 = got_opentemp();
if (f2 == NULL) {
fclose(f1);
- return got_error(GOT_ERR_FILE_OPEN);
+ return got_error_from_errno();
}
} else
flags |= D_EMPTY2;