Show More
@@ -63,6 +63,7 b' typedef struct {' | |||||
63 |
|
63 | |||
64 | struct hgclient_tag_ { |
|
64 | struct hgclient_tag_ { | |
65 | int sockfd; |
|
65 | int sockfd; | |
|
66 | pid_t pgid; | |||
66 | pid_t pid; |
|
67 | pid_t pid; | |
67 | context_t ctx; |
|
68 | context_t ctx; | |
68 | unsigned int capflags; |
|
69 | unsigned int capflags; | |
@@ -339,6 +340,8 b' static void readhello(hgclient_t *hgc)' | |||||
339 | u = dataend; |
|
340 | u = dataend; | |
340 | if (strncmp(s, "capabilities:", t - s + 1) == 0) { |
|
341 | if (strncmp(s, "capabilities:", t - s + 1) == 0) { | |
341 | hgc->capflags = parsecapabilities(t + 2, u); |
|
342 | hgc->capflags = parsecapabilities(t + 2, u); | |
|
343 | } else if (strncmp(s, "pgid:", t - s + 1) == 0) { | |||
|
344 | hgc->pgid = strtol(t + 2, NULL, 10); | |||
342 | } else if (strncmp(s, "pid:", t - s + 1) == 0) { |
|
345 | } else if (strncmp(s, "pid:", t - s + 1) == 0) { | |
343 | hgc->pid = strtol(t + 2, NULL, 10); |
|
346 | hgc->pid = strtol(t + 2, NULL, 10); | |
344 | } |
|
347 | } | |
@@ -463,6 +466,12 b' void hgc_close(hgclient_t *hgc)' | |||||
463 | free(hgc); |
|
466 | free(hgc); | |
464 | } |
|
467 | } | |
465 |
|
468 | |||
|
469 | pid_t hgc_peerpgid(const hgclient_t *hgc) | |||
|
470 | { | |||
|
471 | assert(hgc); | |||
|
472 | return hgc->pgid; | |||
|
473 | } | |||
|
474 | ||||
466 | pid_t hgc_peerpid(const hgclient_t *hgc) |
|
475 | pid_t hgc_peerpid(const hgclient_t *hgc) | |
467 | { |
|
476 | { | |
468 | assert(hgc); |
|
477 | assert(hgc); |
@@ -18,6 +18,7 b' typedef struct hgclient_tag_ hgclient_t;' | |||||
18 | hgclient_t *hgc_open(const char *sockname); |
|
18 | hgclient_t *hgc_open(const char *sockname); | |
19 | void hgc_close(hgclient_t *hgc); |
|
19 | void hgc_close(hgclient_t *hgc); | |
20 |
|
20 | |||
|
21 | pid_t hgc_peerpgid(const hgclient_t *hgc); | |||
21 | pid_t hgc_peerpid(const hgclient_t *hgc); |
|
22 | pid_t hgc_peerpid(const hgclient_t *hgc); | |
22 |
|
23 | |||
23 | const char **hgc_validate(hgclient_t *hgc, const char *const args[], |
|
24 | const char **hgc_validate(hgclient_t *hgc, const char *const args[], |
General Comments 0
You need to be logged in to leave comments.
Login now