Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Do not run pkg_shutdown function too often
Baptiste Daroussin committed 5 years ago
commit 380ac7f31cf13db2332da414220b33cd906dcdc7
parent c6da282
4 files changed +6 -6
modified libpkg/lua_scripts.c
@@ -140,16 +140,16 @@ pkg_lua_script_run(struct pkg * const pkg, pkg_lua_script type, bool upgrade)
			if (luaL_dostring(L, lscript->script)) {
				pkg_emit_error("Failed to execute lua script: %s", lua_tostring(L, -1));
				lua_close(L);
-
				exit(1);
+
				_exit(1);
			}

			if (lua_tonumber(L, -1) != 0) {
				lua_close(L);
-
				exit(1);
+
				_exit(1);
			}

			lua_close(L);
-
			exit(0);
+
			_exit(0);
		} else if (pid < 0) {
			pkg_emit_errno("Cannot fork", "lua_script");
			ret = EPKG_FATAL;
modified libpkg/pkg_repo_create.c
@@ -472,7 +472,7 @@ cleanup:
	free(mdigest);

	pkg_debug(1, "worker done");
-
	exit(ret);
+
	_exit(ret);
}

static int
modified src/event.c
@@ -228,7 +228,7 @@ event_sandboxed_call(pkg_sandbox_cb func, int fd, void *ud)
#ifdef HAVE_CAPSICUM
	if (cap_enter() < 0 && errno != ENOSYS) {
		warn("cap_enter() failed");
-
		return (EPKG_FATAL);
+
		_exit(EXIT_FAILURE);
	}
#endif

modified src/upgrade.c
@@ -205,7 +205,7 @@ add_vulnerable_upgrades(struct pkg_jobs *jobs, struct pkgdb *db)
		close(sp[1]);
		check_vulnerable(audit, db, sp[0]);
		close(sp[0]);
-
		exit(EXIT_SUCCESS);
+
		_exit(EXIT_SUCCESS);
		break;
	case -1:
		warnx("Cannot fork");