Compare commits
1 Commits
build/reen
...
66e5aea7ef
| Author | SHA1 | Date | |
|---|---|---|---|
|
66e5aea7ef
|
@@ -38,7 +38,6 @@
|
||||
#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>
|
||||
@@ -72,11 +71,7 @@ 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,
|
||||
@@ -170,7 +165,6 @@ 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) {
|
||||
@@ -184,7 +178,6 @@ 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");
|
||||
@@ -227,7 +220,6 @@ 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