Compare commits
No commits in common. "9a8528abedc07c8447c4dd09c8f415960885f919" and "1620d0367150de583065d448564bcbf0c11b99d3" have entirely different histories.
9a8528abed
...
1620d03671
4 changed files with 18 additions and 84 deletions
|
@ -67,7 +67,7 @@ jobs:
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "{
|
-d "{
|
||||||
\"body\": \"$(jq .body < "${THE_ACTION_WORKING_DIRECTORY}/current_release_info.json" | sed -e 's/^"//' -e 's/"$//')
|
\"body\": \"$(jq .body < "${THE_ACTION_WORKING_DIRECTORY}/current_release_info.json" | sed -e 's/^"//' -e 's/"$//')
|
||||||
$(find "${THE_ACTION_WORKING_DIRECTORY}" -maxdepth 1 -name "*${BUILD_ASSET_NAME}" -execdir sha256sum '{}' ';' | sed -e 's|\./break|break|')\"
|
$(find "${THE_ACTION_WORKING_DIRECTORY}" -maxdepth 1 -name "*${BUILD_ASSET_NAME}" -execdir sha256sum '{}' ';')\"
|
||||||
}" >&/dev/null
|
}" >&/dev/null
|
||||||
curl --fail-with-body -X POST \
|
curl --fail-with-body -X POST \
|
||||||
"https://git.seodisparate.com/api/v1/repos/stephenseo/break_interval/releases/$(jq .id < "${THE_ACTION_WORKING_DIRECTORY}/release_info.json")/assets" \
|
"https://git.seodisparate.com/api/v1/repos/stephenseo/break_interval/releases/$(jq .id < "${THE_ACTION_WORKING_DIRECTORY}/release_info.json")/assets" \
|
||||||
|
@ -119,7 +119,7 @@ jobs:
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "{
|
-d "{
|
||||||
\"body\": \"$(jq .body < "${THE_ACTION_WORKING_DIRECTORY}/current_release_info.json" | sed -e 's/^"//' -e 's/"$//')
|
\"body\": \"$(jq .body < "${THE_ACTION_WORKING_DIRECTORY}/current_release_info.json" | sed -e 's/^"//' -e 's/"$//')
|
||||||
$(find "${THE_ACTION_WORKING_DIRECTORY}" -maxdepth 1 -name "*${BUILD_ASSET_NAME}" -execdir sha256sum '{}' ';' | sed -e 's|\./break|break|')\"
|
$(find "${THE_ACTION_WORKING_DIRECTORY}" -maxdepth 1 -name "*${BUILD_ASSET_NAME}" -execdir sha256sum '{}' ';')\"
|
||||||
}" >&/dev/null
|
}" >&/dev/null
|
||||||
curl --fail-with-body -X POST \
|
curl --fail-with-body -X POST \
|
||||||
"https://git.seodisparate.com/api/v1/repos/stephenseo/break_interval/releases/$(jq .id < "${THE_ACTION_WORKING_DIRECTORY}/release_info.json")/assets" \
|
"https://git.seodisparate.com/api/v1/repos/stephenseo/break_interval/releases/$(jq .id < "${THE_ACTION_WORKING_DIRECTORY}/release_info.json")/assets" \
|
||||||
|
|
|
@ -8,6 +8,8 @@ add_executable(break_interval ${break_interval_SOURCES})
|
||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wall -Wextra -Wpedantic -Wno-missing-braces
|
-Wall -Wextra -Wpedantic -Wno-missing-braces
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-Weffc++>
|
||||||
|
$<$<CONFIG:DEBUG>:-Og>
|
||||||
)
|
)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
@ -15,49 +17,3 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_options(break_interval PUBLIC
|
|
||||||
-Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough
|
|
||||||
-Werror=format-security
|
|
||||||
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
|
|
||||||
-D_GLIBCXX_ASSERTIONS
|
|
||||||
-fstrict-flex-arrays=3
|
|
||||||
-fstack-clash-protection -fstack-protector-strong
|
|
||||||
-Wl,-z,nodlopen -Wl,-z,noexecstack
|
|
||||||
-Wl,-z,relro -Wl,-z,now
|
|
||||||
-Wl,--as-needed -Wl,--no-copy-dt-needed-entries
|
|
||||||
-fPIE -pie
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_options(break_interval PUBLIC
|
|
||||||
-Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough
|
|
||||||
-Werror=format-security
|
|
||||||
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
|
|
||||||
-D_GLIBCXX_ASSERTIONS
|
|
||||||
-fstrict-flex-arrays=3
|
|
||||||
-fstack-clash-protection -fstack-protector-strong
|
|
||||||
-Wl,-z,nodlopen -Wl,-z,noexecstack
|
|
||||||
-Wl,-z,relro -Wl,-z,now
|
|
||||||
-Wl,--as-needed -Wl,--no-copy-dt-needed-entries
|
|
||||||
-fPIE -pie
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
||||||
target_compile_options(break_interval PUBLIC
|
|
||||||
-O3
|
|
||||||
-fno-delete-null-pointer-checks -fno-strict-overflow
|
|
||||||
-fno-strict-aliasing -ftrivial-auto-var-init=zero
|
|
||||||
)
|
|
||||||
target_link_options(break_interval PUBLIC
|
|
||||||
-O3
|
|
||||||
-fno-delete-null-pointer-checks -fno-strict-overflow
|
|
||||||
-fno-strict-aliasing -ftrivial-auto-var-init=zero
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
target_compile_options(break_interval PUBLIC
|
|
||||||
-Og
|
|
||||||
)
|
|
||||||
target_link_options(break_interval PUBLIC
|
|
||||||
-Og
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -2,13 +2,6 @@
|
||||||
|
|
||||||
## Upcoming Changes
|
## Upcoming Changes
|
||||||
|
|
||||||
## Version 1.3.3
|
|
||||||
|
|
||||||
Minor tweak to action/workflow for release assets.
|
|
||||||
Compiler hardening flags, fixes related to flags.
|
|
||||||
Internal change: make flag used by signal "volatile" (doesn't change much for
|
|
||||||
users).
|
|
||||||
|
|
||||||
## Version 1.3.2
|
## Version 1.3.2
|
||||||
|
|
||||||
Updated action/workflow to build for Debian aarch64.
|
Updated action/workflow to build for Debian aarch64.
|
||||||
|
|
43
src/main.c
43
src/main.c
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#define DEFAULT_FILE_PLAYER_PROGRAM "/usr/bin/mpv"
|
#define DEFAULT_FILE_PLAYER_PROGRAM "/usr/bin/mpv"
|
||||||
|
|
||||||
volatile int is_running;
|
int is_running;
|
||||||
|
|
||||||
void interval_notification_handle_signal(int sig) {
|
void interval_notification_handle_signal(int sig) {
|
||||||
if (sig == SIGINT) {
|
if (sig == SIGINT) {
|
||||||
|
@ -104,12 +104,9 @@ int play_jingle_from_file(char *player,
|
||||||
default:
|
default:
|
||||||
if (use_internal_file_specified != 0) {
|
if (use_internal_file_specified != 0) {
|
||||||
close(pipe_filedes[0]);
|
close(pipe_filedes[0]);
|
||||||
ssize_t ret = write(pipe_filedes[1],
|
write(pipe_filedes[1],
|
||||||
interval_notification_mp3,
|
interval_notification_mp3,
|
||||||
interval_notification_mp3_len);
|
interval_notification_mp3_len);
|
||||||
if (ret != interval_notification_mp3_len) {
|
|
||||||
fprintf(stderr, "WARNING: Did not write all bytes of mp3 to player!\n");
|
|
||||||
}
|
|
||||||
close(pipe_filedes[1]);
|
close(pipe_filedes[1]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -164,16 +161,11 @@ int play_jingle_from_memory(void) {
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
close(pipe_filedes[0]);
|
||||||
close(pipe_filedes[0]);
|
write(pipe_filedes[1],
|
||||||
ssize_t ret = write(pipe_filedes[1],
|
interval_notification_mp3,
|
||||||
interval_notification_mp3,
|
interval_notification_mp3_len);
|
||||||
interval_notification_mp3_len);
|
close(pipe_filedes[1]);
|
||||||
if (ret != interval_notification_mp3_len) {
|
|
||||||
fprintf(stderr, "WARNING: Did not write all bytes of mp3 to player!\n");
|
|
||||||
}
|
|
||||||
close(pipe_filedes[1]);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,8 +185,7 @@ int main(int argc, char **argv) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int minutes;
|
unsigned int minutes = 5;
|
||||||
int temp_minutes = 5;
|
|
||||||
char *file_name = NULL;
|
char *file_name = NULL;
|
||||||
char *player_name = NULL;
|
char *player_name = NULL;
|
||||||
char **player_args = NULL;
|
char **player_args = NULL;
|
||||||
|
@ -209,34 +200,28 @@ int main(int argc, char **argv) {
|
||||||
print_help();
|
print_help();
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
temp_minutes = atoi(argv[1]);
|
minutes = atoi(argv[1]);
|
||||||
} else if (argc == 3) {
|
} else if (argc == 3) {
|
||||||
temp_minutes = atoi(argv[1]);
|
minutes = atoi(argv[1]);
|
||||||
file_name = argv[2];
|
file_name = argv[2];
|
||||||
} else if (argc == 4) {
|
} else if (argc == 4) {
|
||||||
temp_minutes = atoi(argv[1]);
|
minutes = atoi(argv[1]);
|
||||||
file_name = argv[2];
|
file_name = argv[2];
|
||||||
player_name = argv[3];
|
player_name = argv[3];
|
||||||
} else if (argc > 4) {
|
} else if (argc > 4) {
|
||||||
temp_minutes = atoi(argv[1]);
|
minutes = atoi(argv[1]);
|
||||||
file_name = argv[2];
|
file_name = argv[2];
|
||||||
player_name = argv[3];
|
player_name = argv[3];
|
||||||
player_args = argv + 4;
|
player_args = argv + 4;
|
||||||
args_count = (unsigned int)(argc - 4);
|
args_count = argc - 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (temp_minutes == 0) {
|
if (minutes == 0) {
|
||||||
puts("ERROR: Minutes cannot be set to zero!");
|
puts("ERROR: Minutes cannot be set to zero!");
|
||||||
print_help();
|
print_help();
|
||||||
return 3;
|
return 3;
|
||||||
} else if (temp_minutes < 0) {
|
|
||||||
puts("ERROR: Minutes cannot be negative!");
|
|
||||||
print_help();
|
|
||||||
return 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
minutes = (unsigned int)temp_minutes;
|
|
||||||
|
|
||||||
printf("Set to %u minutes...\n", minutes);
|
printf("Set to %u minutes...\n", minutes);
|
||||||
if (player_name) {
|
if (player_name) {
|
||||||
printf("Using player \"%s\"...\n", player_name);
|
printf("Using player \"%s\"...\n", player_name);
|
||||||
|
|
Loading…
Reference in a new issue