aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-07-05 19:22:23 +0200
committerdec05eba <dec05eba@protonmail.com>2021-07-11 21:00:35 +0200
commit9d71f913744ab567a49195a43c525c0d494fe084 (patch)
treeb485cc59539e5e0ebd635465b7ccd47c5d2351fd
parentb184475290e204bdcfd833d34939440c4a81430b (diff)
Prepare for imagemagick removal, use vfork instead of fork
-rw-r--r--README.md2
-rw-r--r--TODO2
-rw-r--r--src/Program.cpp10
3 files changed, 7 insertions, 7 deletions
diff --git a/README.md b/README.md
index 6a8c381..aac49b3 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ If you are running arch linux then you can install QuickMedia from aur (https://
### Libraries
`sfml`, `libx11`, `libxrandr`, `jsoncpp`, `libglvnd` (opengl)
### Executables
-`curl`, `imagemagick`
+`curl`
### Fonts
`noto-fonts`
### Optional
diff --git a/TODO b/TODO
index f3d2790..3d74d0a 100644
--- a/TODO
+++ b/TODO
@@ -122,7 +122,7 @@ Dynamically fetch 4chan api key, if it ever changes in the future. Same for yout
Set curl download limits everywhere (when saving to file, downloading to json, etc...).
In the downloader if we already have the url in thumbnail/video cache, then copy it to the destination instead of redownloading it. This would also fix downloading images when viewing a manga page.
Update timestamp of messages posted with matrix (and move them to the correct place in the timeline) when we receive the message from the server. This is needed when the localtime is messed up (for example when rebooting from windows into linux).
-Remove dependency on imagemagick and create a function that forks the processes and creates a thumbnail from an input filepath and output filepath. That new process can use sf::Image to load and save the images.
+When sfml dependency is removed use libvips for image manipulation. Its a very fast library, especially for thumbnail creation.
Notification race condition when fetching the first notifications page and receiving a notification immediately after the first sync? we might end up with a duplicate notification.
Submit on notifications item in matrix should jump to the message in the room.
Notifications should load their replied-to-message.
diff --git a/src/Program.cpp b/src/Program.cpp
index c0e0eca..5daf25c 100644
--- a/src/Program.cpp
+++ b/src/Program.cpp
@@ -96,9 +96,9 @@ int exec_program_pipe(const char **args, ReadProgram *read_program) {
pid_t parent_pid = getpid();
- pid_t pid = fork();
+ pid_t pid = vfork();
if(pid == -1) {
- perror("Failed to fork");
+ perror("Failed to vfork");
close(fd[READ_END]);
close(fd[WRITE_END]);
return -3;
@@ -238,10 +238,10 @@ int exec_program_async(const char **args, pid_t *result_process_id) {
pid_t parent_pid = getpid();
- pid_t pid = fork();
+ pid_t pid = vfork();
if(pid == -1) {
int err = errno;
- perror("Failed to fork");
+ perror("Failed to vfork");
return -err;
} else if(pid == 0) { /* child */
if(result_process_id) {
@@ -262,7 +262,7 @@ int exec_program_async(const char **args, pid_t *result_process_id) {
signal(SIGHUP, SIG_IGN);
// Daemonize child to make the parent the init process which will reap the zombie child
- pid_t second_child = fork();
+ pid_t second_child = vfork();
if(second_child == 0) { // child
execvp(args[0], (char* const*)args);
perror("execvp");