Skip to content

Commit

Permalink
Verbosity of different modules
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Jun 18, 2024
1 parent 78a202c commit cfa644c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/hal/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ enum ConfigError parse_param_value(
regmatch_t m[n_matches];
int match = regexec(&regex, ini->str + start_pos, n_matches, m, 0);
regfree(&regex);
if (match > 0 || (end_pos >= 0 && end_pos - start_pos < m[1].rm_so)) {
printf("Can't find '%s' in section '%s'.\n", param_name, section);
if (match > 0 || (end_pos >= 0 && end_pos - start_pos < m[1].rm_so))
return CONFIG_PARAM_NOT_FOUND;
}

int res = sprintf(param_value, "%.*s", (int)(m[1].rm_eo - m[1].rm_so),
ini->str + start_pos + m[1].rm_so);
Expand Down Expand Up @@ -280,10 +278,8 @@ enum ConfigError parse_uint32(

bool open_config(struct IniConfig *ini, const char *path) {
FILE *file = fopen(path, "rb");
if (!file) {
printf("Can't open file %s\n", path);
if (!file)
return false;
}

fseek(file, 0, SEEK_END);
size_t length = ftell(file);
Expand Down
1 change: 1 addition & 0 deletions src/jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void jpeg_deinit() {
active:
jpeg_module_init = false;
pthread_mutex_unlock(&jpeg_mutex);
printf(tag "Module de-initialization completed!\n");
}

int jpeg_get(short width, short height, char quality, char grayscale,
Expand Down
2 changes: 1 addition & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ void *server_thread(void *vargp) {
"Content-Type: application/json;charset=UTF-8\r\n" \
"Connection: close\r\n" \
"\r\n" \
"{\"width\":%d,\"height\":%d,\"fps\":%d,\"qfactor\":%d}",
"{\"width\":%d,\"height\":%d,\"qfactor\":%d}",
app_config.jpeg_width, app_config.jpeg_height, app_config.jpeg_qfactor);
} else {
respLen = sprintf(response,
Expand Down
2 changes: 2 additions & 0 deletions src/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ void watchdog_stop(void) {
write(fd, "V", 1);
close(fd);
fd = 0;

fprintf(stderr, "[watchdog] Watchdog stopped!\n");
}

0 comments on commit cfa644c

Please sign in to comment.