Skip to content

Commit

Permalink
fix: #3 small code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ya-Pasha-364shy committed May 9, 2023
1 parent f43551b commit bcc98be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions helpers/helpers_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int helpers_get_keep_running()
return keep_running;
}

// unused yet
#if 0
void helpers_mutex_trylock(pthread_mutex_t * mutex)
{
fprintf(stderr, "<%s>\n", __func__);
Expand Down Expand Up @@ -54,6 +54,7 @@ void helpers_mutex_trylock(pthread_mutex_t * mutex)
}
}
}
#endif

/* ===================== */
/* HANDLE INOTIFY CALLS */
Expand Down Expand Up @@ -247,12 +248,16 @@ void * pthread_on_dir_run(void * argument)
{
if (HELPERS_INVALID_EXIT == process_inotify_events(queue, inotify_fd, arg))
{
if (queue)
queue_destroy(queue);
goto out;
}
}

if (HELPERS_INVALID_EXIT == close_inotify_fd(inotify_fd))
{
if (queue)
queue_destroy(queue);
goto out;
}
queue_destroy(queue);
Expand Down Expand Up @@ -387,7 +392,7 @@ static void handle_event(queue_entry_t event, thread_argument_t * arg)
}
default:
{
// need for handle CTRL+S signal to saving file
// need for handle CTRL+S signal to saving file (for example)
sprintf(message_buffer, "UNKNOWN EVENT \"%X\" OCCURRED for file \"%s\", need to backup",
event->inot_ev.mask, cur_event_filename);
need_to_backup = true;
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ int main(int argc, char * argv[])

pthread_mutex_destroy(&mutex);
return free_and_exit(rc);
}
}

0 comments on commit bcc98be

Please sign in to comment.