Compare commits
3 Commits
66e5aea7ef
...
build/auto
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ef9395882 | |||
|
a3e23c3514
|
|||
|
ad294cdd6d
|
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
flavor: [arch, debian, fedora, ubuntu]
|
||||
flavor: [arch, debian, ubuntu]
|
||||
|
||||
name: Linux
|
||||
steps:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
AC_PREREQ([2.72])
|
||||
AC_INIT([profanity],[0.15.0],[jubalh@iodoru.org],[profanity],[https://profanity-im.github.io/])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@@ -95,7 +95,7 @@ PKG_CHECK_MODULES([curl], [libcurl >= 7.62.0], [],
|
||||
PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.22.0], [],
|
||||
[AC_MSG_ERROR([sqlite3 3.22.0 or higher is required])])
|
||||
|
||||
ACX_PTHREAD([], [AC_MSG_ERROR([pthread is required])])
|
||||
AX_PTHREAD([],[AC_MSG_ERROR([pthread is required])])
|
||||
AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])
|
||||
|
||||
### plugins
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <glib.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h> // necessary for readline
|
||||
#include <readline/readline.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
@@ -71,7 +72,11 @@ editor_thread(void* arg)
|
||||
if (pid > 0) {
|
||||
task->pid = pid;
|
||||
int status;
|
||||
// Unlock mutex to avoid deadlock on the main loop
|
||||
pthread_mutex_unlock(&task->mutex);
|
||||
waitpid(pid, &status, 0);
|
||||
pthread_mutex_lock(&task->mutex);
|
||||
|
||||
gsize length;
|
||||
if (!g_file_get_contents(task->filename, &task->result, &length, &task->error)) {
|
||||
log_error("[Editor] could not read from %s: %s", task->filename,
|
||||
@@ -165,6 +170,7 @@ get_message_from_editor_async(gchar* message)
|
||||
|
||||
// Set background mode
|
||||
background_mode = TRUE;
|
||||
log_debug("[Editor] Entering background mode");
|
||||
|
||||
// Start editor thread
|
||||
if (pthread_create(&editor_task.thread, NULL, editor_thread, &editor_task) != 0) {
|
||||
@@ -178,6 +184,7 @@ get_message_from_editor_async(gchar* message)
|
||||
editor_task.editor_cmd = NULL;
|
||||
pthread_mutex_unlock(&editor_task.mutex);
|
||||
background_mode = FALSE;
|
||||
log_debug("[Editor] Exiting background mode");
|
||||
reset_prog_mode();
|
||||
doupdate();
|
||||
log_error("[Editor] Failed to create editor thread");
|
||||
@@ -220,6 +227,7 @@ editor_process(ProfWin* window)
|
||||
}
|
||||
pthread_mutex_unlock(&editor_task.mutex);
|
||||
background_mode = FALSE;
|
||||
log_debug("[Editor] Exiting background mode");
|
||||
}
|
||||
|
||||
// Deprecated synchronous editor call. Returns a message as returned_message.
|
||||
|
||||
Reference in New Issue
Block a user