Skip to content

Commit

Permalink
chores: reduce usage of SQSH_ERROR_TODO.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed May 20, 2023
1 parent f3a3a5c commit 8e1a788
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions include/sqsh_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ enum SqshError {
SQSH_ERROR_MAPPER_INIT,
SQSH_ERROR_MAPPER_MAP,
SQSH_ERROR_CURL_INVALID_RANGE_HEADER,
SQSL_ERROR_ELEMENT_NOT_FOUND,
SQSH_ERROR_INVALID_ARGUMENT,
SQSH_ERROR_TODO,
};

Expand Down
4 changes: 2 additions & 2 deletions lib/archive/trailing_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ sqsh__trailing_init(
uint64_t trailing_size;

if (archive_size <= trailing_start) {
rv = -SQSH_ERROR_TODO;
rv = -SQSH_ERROR_SIZE_MISSMATCH;
goto out;
}

if (SQSH_SUB_OVERFLOW(archive_size, trailing_start, &trailing_size)) {
rv = -SQSH_ERROR_TODO;
rv = -SQSH_ERROR_INTEGER_OVERFLOW;
goto out;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/primitive/rc_hash_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ sqsh__rc_hash_map_release(struct SqshRcHashMap *hash_map, const void *element) {
return sqsh__rc_map_release(values, element);
}
}
return -SQSH_ERROR_TODO;
return -SQSL_ERROR_ELEMENT_NOT_FOUND;
}

int
Expand Down
2 changes: 1 addition & 1 deletion lib/table/export_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sqsh_export_table_resolve_inode(
const struct SqshExportTable *table, uint32_t inode,
uint64_t *inode_ref) {
if (inode < 1) {
return -SQSH_ERROR_TODO;
return -SQSH_ERROR_INVALID_ARGUMENT;
}
return sqsh_table_get(&table->table, inode - 1, inode_ref);
}
Expand Down
4 changes: 4 additions & 0 deletions lib/utils/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ sqsh_error_str(int error_code) {
return "Compression unkown";
case SQSH_ERROR_CURL_INVALID_RANGE_HEADER:
return "Invalid range header";
case SQSL_ERROR_ELEMENT_NOT_FOUND:
return "Element not found";
case SQSH_ERROR_INVALID_ARGUMENT:
return "Invalid argument";
case SQSH_ERROR_TODO:
return "Todo";
}
Expand Down

0 comments on commit 8e1a788

Please sign in to comment.