Skip to content

Commit

Permalink
move stdout message to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
core software devel committed Jul 18, 2024
1 parent ebaa63a commit 5a2f48c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ldb.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "./ldb/types.h"
#include "./ldb/mz.h"

#define LDB_VERSION "4.1.1"
#define LDB_VERSION "4.1.3"

#define LDB_TABLE_DEFINITION_UNDEFINED -1
#define LDB_TABLE_DEFINITION_STANDARD 0
Expand Down
11 changes: 6 additions & 5 deletions src/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void ldb_load_node(struct ldb_recordset *rs)

/* Read node */
rs->node = malloc(rs->node_ln + 1);
if (!fread(rs->node, 1, rs->node_ln, rs->sector)) printf("Warning: cannot load node\n");
if (!fread(rs->node, 1, rs->node_ln, rs->sector)) log_info("Warning: cannot load node\n");

/* Terminate with a chr(0) */
rs->node[rs->node_ln] = 0;
Expand Down Expand Up @@ -229,7 +229,8 @@ uint64_t ldb_node_read(uint8_t *sector, struct ldb_table table, FILE *ldb_sector
{
fseeko64(ldb_sector, ptr, SEEK_SET);
buffer = calloc(LDB_PTR_LN + table.ts_ln + LDB_KEY_LN, 1);
if (!fread(buffer, 1, LDB_PTR_LN + table.ts_ln, ldb_sector)) printf("Warning: cannot read LDB node\n");
if (!fread(buffer, 1, LDB_PTR_LN + table.ts_ln, ldb_sector))
log_info("Warning: cannot read LDB node\n");
}

/* NN: Obtain the next node */
Expand Down Expand Up @@ -261,7 +262,7 @@ uint64_t ldb_node_read(uint8_t *sector, struct ldb_table table, FILE *ldb_sector
}
else
{
if (!fread(*out, 1, actual_size, ldb_sector)) printf("Warning: cannot read entire LDB node\n");
if (!fread(*out, 1, actual_size, ldb_sector)) log_info("Warning: cannot read entire LDB node\n");
}
*bytes_read = actual_size;

Expand Down Expand Up @@ -323,7 +324,7 @@ void ldb_node_unlink (struct ldb_table table, uint8_t *key)
uint8_t *buffer = malloc(LDB_PTR_LN + table.ts_ln + table.key_ln);
if (!fread(buffer, 1, LDB_PTR_LN + table.ts_ln, ldb_sector))
{
printf("Warning: cannot read LDB node info\n");
log_info("Warning: cannot read LDB node info\n");
break;
}

Expand Down Expand Up @@ -354,7 +355,7 @@ void ldb_node_unlink (struct ldb_table table, uint8_t *key)
/* Read K and GS (2) if needed */
if (!fread(buffer, 1, get_bytes, ldb_sector))
{
printf("Warning: cannot read LDB node info (K/GS)\n");
log_info("Warning: cannot read LDB node info (K/GS)\n");
break;
}

Expand Down

0 comments on commit 5a2f48c

Please sign in to comment.