Modified some signatures
This commit is contained in:
31
src/entry.c
31
src/entry.c
@@ -62,34 +62,3 @@ Result entry_exists(const char* entry_id, bool* out_exists) {
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
Result add_entry(const char* entry_id) {
|
||||
// Check if the entry already exists
|
||||
bool exists;
|
||||
Result result = entry_exists(entry_id, &exists);
|
||||
if (result != SUCCESS)
|
||||
return result;
|
||||
|
||||
if (exists) {
|
||||
log_message(LOG_LEVEL_ERROR, "Entry '%s' already exists.", entry_id);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
// Create the entry directory
|
||||
char* path;
|
||||
result = get_entry_path(entry_id, &path);
|
||||
if (result != SUCCESS)
|
||||
return result;
|
||||
|
||||
int result_code = mkdir(path, 0755);
|
||||
|
||||
free(path);
|
||||
|
||||
// Check if the operation failed
|
||||
if (result_code != 0) {
|
||||
log_message(LOG_LEVEL_ERROR, "Failed to create entry '%s' (%s).", entry_id, strerror(errno));
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user