From 6a273af10517d1f7e4ea85635f1d25a9158adeb5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 13 May 2023 10:40:53 +0800 Subject: refactor: remove typval.h from most header files (#23601) Because typval_defs.h is enough for most of them. --- src/nvim/event/process.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/event/process.h') diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index e0057faffb..39fed08c77 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -5,7 +5,6 @@ #include #include -#include "nvim/eval/typval.h" #include "nvim/eval/typval_defs.h" #include "nvim/event/loop.h" #include "nvim/event/multiqueue.h" -- cgit From 559c4cfd52e385c1b9bd5fa66a0eeb7e8d9e018a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 8 Jul 2023 08:27:39 +0800 Subject: fix(startup): run embedded Nvim with real path (#24282) fix(startup): run embedded process with real path --- src/nvim/event/process.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/nvim/event/process.h') diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index 39fed08c77..69fe229b0e 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -32,6 +32,7 @@ struct process { uint64_t stopped_time; // process_stop() timestamp const char *cwd; char **argv; + const char *exepath; dict_T *env; Stream in, out, err; /// Exit handler. If set, user must call process_free(). @@ -54,6 +55,7 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data) .stopped_time = 0, .cwd = NULL, .argv = NULL, + .exepath = NULL, .in = { .closed = false }, .out = { .closed = false }, .err = { .closed = false }, @@ -66,6 +68,12 @@ static inline Process process_init(Loop *loop, ProcessType type, void *data) }; } +/// Get the path to the executable of the process. +static inline const char *process_get_exepath(Process *proc) +{ + return proc->exepath != NULL ? proc->exepath : proc->argv[0]; +} + static inline bool process_is_stopped(Process *proc) { bool exited = (proc->status >= 0); -- cgit From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/event/process.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/nvim/event/process.h') diff --git a/src/nvim/event/process.h b/src/nvim/event/process.h index 69fe229b0e..234fc815af 100644 --- a/src/nvim/event/process.h +++ b/src/nvim/event/process.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EVENT_PROCESS_H -#define NVIM_EVENT_PROCESS_H +#pragma once #include #include @@ -83,4 +82,3 @@ static inline bool process_is_stopped(Process *proc) #ifdef INCLUDE_GENERATED_DECLARATIONS # include "event/process.h.generated.h" #endif -#endif // NVIM_EVENT_PROCESS_H -- cgit