Skip to content

Commit

Permalink
style consistencies, expect a different codestyle later tho
Browse files Browse the repository at this point in the history
  • Loading branch information
faithanalog committed Feb 27, 2021
1 parent 11cc4d8 commit ae801b9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions rtmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ struct Dwell_State state =
.just_became_active = true
};

void write_status(const char* status) {
if (config.write_status) {
void write_status(const char* status)
{
if (config.write_status)
{
FILE* stat_file = fopen(config.status_file, "w");
if (!stat_file) {
if (!stat_file)
{
char err_buff[256];
snprintf(err_buff, sizeof(err_buff), "write_active_status: error opening status file %s", config.status_file);
perror(err_buff);
Expand All @@ -88,8 +91,10 @@ void write_status(const char* status) {
}
}

void write_active_status() {
if (state.active) {
void write_active_status()
{
if (state.active)
{
write_status("rtmouse enabled");
} else {
write_status("rtmouse disabled");
Expand Down Expand Up @@ -140,7 +145,8 @@ void handle_unix_signal(int signal)
}
}

void handle_termination_signal(int signal) {
void handle_termination_signal(int signal)
{
write_status("rtmouse terminated");
exit(0);
}
Expand Down

0 comments on commit ae801b9

Please sign in to comment.