char *envp[],
ExecDirFlags flags) {
- _cleanup_hashmap_free_free_ Hashmap *pids = NULL;
+ _cleanup_hashmap_free_ Hashmap *pids = NULL;
bool parallel_execution;
int r;
parallel_execution = FLAGS_SET(flags, EXEC_DIR_PARALLEL) && !callbacks;
- if (parallel_execution) {
- pids = hashmap_new(NULL);
- if (!pids)
- return log_oom();
- }
-
/* Abort execution of this process after the timeout. We simply rely on SIGALRM as
* default action terminating the process, and turn on alarm(). */
continue;
if (parallel_execution) {
- r = hashmap_put(pids, PID_TO_PTR(pid), t);
+ r = hashmap_ensure_put(&pids, &trivial_hash_ops_value_free, PID_TO_PTR(pid), t);
if (r < 0)
return log_oom();
t = NULL;