Keep vext .so files with -p debug=+vmod_so_keep

Required for seamless debugging.

Alternatives considered:
- add vext_so_keep debug flag -> overkill

To decide:
- rename to libso_keep / "Keep copied VMOD/VEXT libraries" ?
  (libso to disambiguate from so for socket option)
parent 9bbfc004
...@@ -158,14 +158,15 @@ vext_load(void) ...@@ -158,14 +158,15 @@ vext_load(void)
} }
void void
vext_cleanup(void) vext_cleanup(int do_unlink)
{ {
struct vext *vp; struct vext *vp;
VTAILQ_FOREACH(vp, &vext_list, list) { VTAILQ_FOREACH(vp, &vext_list, list) {
fprintf(stderr, "ee3 %s\n", VSB_data(vp->vsb)); fprintf(stderr, "ee3 %s\n", VSB_data(vp->vsb));
if (vp->vsb != NULL && VSB_len(vp->vsb) > 0) { if (vp->vsb != NULL && VSB_len(vp->vsb) > 0) {
XXXAZ(unlink(VSB_data(vp->vsb))); if (do_unlink)
XXXAZ(unlink(VSB_data(vp->vsb)));
VSB_clear(vp->vsb); VSB_clear(vp->vsb);
} }
} }
......
...@@ -133,6 +133,6 @@ extern vsm_lock_f *vsmw_unlock; ...@@ -133,6 +133,6 @@ extern vsm_lock_f *vsmw_unlock;
void vext_argument(const char *); void vext_argument(const char *);
void vext_copyin(struct vsb *); void vext_copyin(struct vsb *);
void vext_load(void); void vext_load(void);
void vext_cleanup(void); void vext_cleanup(int);
typedef void vext_iter_f(const char *, void *); typedef void vext_iter_f(const char *, void *);
void vext_iter(vext_iter_f *func, void *); void vext_iter(vext_iter_f *func, void *);
...@@ -285,7 +285,7 @@ mgt_Cflag_atexit(void) ...@@ -285,7 +285,7 @@ mgt_Cflag_atexit(void)
/* Only master process */ /* Only master process */
if (getpid() != heritage.mgt_pid) if (getpid() != heritage.mgt_pid)
return; return;
vext_cleanup(); vext_cleanup(1);
VJ_rmdir("vmod_cache"); VJ_rmdir("vmod_cache");
VJ_rmdir("vext_cache"); VJ_rmdir("vext_cache");
(void)chdir("/"); (void)chdir("/");
...@@ -986,7 +986,7 @@ main(int argc, char * const *argv) ...@@ -986,7 +986,7 @@ main(int argc, char * const *argv)
mgt_cli_close_all(); mgt_cli_close_all();
VEV_Destroy(&mgt_evb); VEV_Destroy(&mgt_evb);
VJ_master(JAIL_MASTER_SYSTEM); VJ_master(JAIL_MASTER_SYSTEM);
vext_cleanup(); vext_cleanup(! MGT_DO_DEBUG(DBG_VMOD_SO_KEEP));
(void)rmdir("vext_cache"); (void)rmdir("vext_cache");
VJ_master(JAIL_MASTER_LOW); VJ_master(JAIL_MASTER_LOW);
VTAILQ_FOREACH(alp, &arglist, list) { VTAILQ_FOREACH(alp, &arglist, list) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment