improved error handling

This commit is contained in:
Fufu Fang 2021-08-31 11:59:28 +01:00
parent 04212c3d55
commit 6713362a5f
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
2 changed files with 70 additions and 70 deletions

View File

@ -901,7 +901,7 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*
EXCLUDE_SYMBOLS = CALLOC exit_failure
EXCLUDE_SYMBOLS = CALLOC lprintf
# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include

View File

@ -32,10 +32,10 @@ static pthread_mutex_t link_lock;
/**
* \brief Create the root linktable for single file mode
*/
static LinkTable *single_LinkTable_new(const char *fn)
static LinkTable *single_LinkTable_new(const char *url)
{
char *ptr = strrchr(fn, '/');
int dir_len = ptr - fn;
char *ptr = strrchr(url, '/');
int dir_len = ptr - url;
char *dir_name = CALLOC(dir_len + 1, sizeof(char));
free(dir_name);
return NULL;
@ -546,7 +546,7 @@ LinkTable *LinkTable_new(const char *url)
*/
if (CACHE_SYSTEM_INIT) {
if (LinkTable_disk_save(linktbl, unescaped_path)) {
exit_failure();
lprintf(error, "Failed to save the LinkTable!\n");
}
}