Skip to content

Commit

Permalink
fix(*): fix version of install path, fix launcher error on Windows, u…
Browse files Browse the repository at this point in the history
…sing Win API to kill process
  • Loading branch information
Water-Melon committed Nov 4, 2023
1 parent eebd86e commit a3bad31
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dl=""
libmelonPath=`./path_generator /usr/local/melon`
libPath=`./path_generator /usr/local/lib/melang_dynamic`
if ! case $os in MINGW*) false;; esac; then
installPath=`./path_generator "$HOME/melang-0.5.0"`
installPath=`./path_generator "$HOME/melang-0.6.0"`
libmelonPath=`./path_generator "$HOME/libmelon"`
libPath=`./path_generator $HOME/lib/melang_dynamic`
elif [ $os == 'Darwin' ]; then
Expand Down
13 changes: 12 additions & 1 deletion lib_src/sys/mln_lang_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -3219,7 +3219,18 @@ static void mln_lang_sys_exec_free(mln_lang_sys_exec_t *se)
mln_tcp_conn_destroy(&se->conn);
mln_socket_close(fd);
if (se->cmd != NULL) mln_string_free(se->cmd);
if (se->running) kill(se->pid, SIGTERM);
if (se->running) {
#if defined(WIN32)
HANDLE handle = NULL;
handle = OpenProcess(PROCESS_TERMINATE, FALSE, se->pid);
if (handle != NULL) {
TerminateProcess(handle, 0);
CloseHandle(handle);
}
#else
kill(se->pid, SIGTERM);
#endif
}
mln_alloc_free(se);
}

Expand Down
2 changes: 1 addition & 1 deletion melang.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ static mln_fd_node_t *head = NULL;
static mln_fd_node_t *tail = NULL;
static pthread_mutex_t lock;
__thread mln_fd_node_t *t_node;
static mln_conf_item_t daemon_conf;
#if !defined(WIN32)
static mln_conf_item_t daemon_conf;
static int daemon_flag = 0;
#endif

Expand Down

0 comments on commit a3bad31

Please sign in to comment.