projects
/
platform
/
upstream
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.25.4
[platform/upstream/git.git]
/
sub-process.c
diff --git
a/sub-process.c
b/sub-process.c
index
8d2a170
..
1b1af9d
100644
(file)
--- a/
sub-process.c
+++ b/
sub-process.c
@@
-6,12
+6,14
@@
#include "pkt-line.h"
int cmd2process_cmp(const void *unused_cmp_data,
#include "pkt-line.h"
int cmd2process_cmp(const void *unused_cmp_data,
- const
void *entry
,
- const
void
*entry_or_key,
+ const
struct hashmap_entry *eptr
,
+ const
struct hashmap_entry
*entry_or_key,
const void *unused_keydata)
{
const void *unused_keydata)
{
- const struct subprocess_entry *e1 = entry;
- const struct subprocess_entry *e2 = entry_or_key;
+ const struct subprocess_entry *e1, *e2;
+
+ e1 = container_of(eptr, const struct subprocess_entry, ent);
+ e2 = container_of(entry_or_key, const struct subprocess_entry, ent);
return strcmp(e1->cmd, e2->cmd);
}
return strcmp(e1->cmd, e2->cmd);
}
@@
-20,9
+22,9
@@
struct subprocess_entry *subprocess_find_entry(struct hashmap *hashmap, const ch
{
struct subprocess_entry key;
{
struct subprocess_entry key;
- hashmap_entry_init(&key, strhash(cmd));
+ hashmap_entry_init(&key
.ent
, strhash(cmd));
key.cmd = cmd;
key.cmd = cmd;
- return hashmap_get
(hashmap, &key
, NULL);
+ return hashmap_get
_entry(hashmap, &key, ent
, NULL);
}
int subprocess_read_status(int fd, struct strbuf *status)
}
int subprocess_read_status(int fd, struct strbuf *status)
@@
-58,7
+60,7
@@
void subprocess_stop(struct hashmap *hashmap, struct subprocess_entry *entry)
kill(entry->process.pid, SIGTERM);
finish_command(&entry->process);
kill(entry->process.pid, SIGTERM);
finish_command(&entry->process);
- hashmap_remove(hashmap,
entry
, NULL);
+ hashmap_remove(hashmap,
&entry->ent
, NULL);
}
static void subprocess_exit_handler(struct child_process *process)
}
static void subprocess_exit_handler(struct child_process *process)
@@
-88,6
+90,7
@@
int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, co
process->out = -1;
process->clean_on_exit = 1;
process->clean_on_exit_handler = subprocess_exit_handler;
process->out = -1;
process->clean_on_exit = 1;
process->clean_on_exit_handler = subprocess_exit_handler;
+ process->trace2_child_class = "subprocess";
err = start_command(process);
if (err) {
err = start_command(process);
if (err) {
@@
-95,7
+98,7
@@
int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, co
return err;
}
return err;
}
- hashmap_entry_init(
entry
, strhash(cmd));
+ hashmap_entry_init(
&entry->ent
, strhash(cmd));
err = startfn(entry);
if (err) {
err = startfn(entry);
if (err) {
@@
-104,7
+107,7
@@
int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, co
return err;
}
return err;
}
- hashmap_add(hashmap,
entry
);
+ hashmap_add(hashmap,
&entry->ent
);
return 0;
}
return 0;
}