Show More
@@ -252,7 +252,7 b' static void handlesystemrequest(hgclient' | |||||
252 | ctx->datasize = sizeof(r_n); |
|
252 | ctx->datasize = sizeof(r_n); | |
253 | writeblock(hgc); |
|
253 | writeblock(hgc); | |
254 | } else if (strcmp(args[0], "pager") == 0) { |
|
254 | } else if (strcmp(args[0], "pager") == 0) { | |
255 | setuppager(args[1]); |
|
255 | setuppager(args[1], args + 3); | |
256 | if (hgc->capflags & CAP_ATTACHIO) |
|
256 | if (hgc->capflags & CAP_ATTACHIO) | |
257 | attachio(hgc); |
|
257 | attachio(hgc); | |
258 | /* unblock the server */ |
|
258 | /* unblock the server */ |
@@ -177,7 +177,7 b' error:' | |||||
177 |
|
177 | |||
178 | /* This implementation is based on hgext/pager.py (post 369741ef7253) |
|
178 | /* This implementation is based on hgext/pager.py (post 369741ef7253) | |
179 | * Return 0 if pager is not started, or pid of the pager */ |
|
179 | * Return 0 if pager is not started, or pid of the pager */ | |
180 | pid_t setuppager(const char *pagercmd) |
|
180 | pid_t setuppager(const char *pagercmd, const char *envp[]) | |
181 | { |
|
181 | { | |
182 | assert(pagerpid == 0); |
|
182 | assert(pagerpid == 0); | |
183 | if (!pagercmd) |
|
183 | if (!pagercmd) | |
@@ -205,7 +205,8 b' pid_t setuppager(const char *pagercmd)' | |||||
205 | close(pipefds[0]); |
|
205 | close(pipefds[0]); | |
206 | close(pipefds[1]); |
|
206 | close(pipefds[1]); | |
207 |
|
207 | |||
208 |
int r = execl |
|
208 | int r = execle("/bin/sh", "/bin/sh", "-c", pagercmd, NULL, | |
|
209 | envp); | |||
209 | if (r < 0) { |
|
210 | if (r < 0) { | |
210 | abortmsgerrno("cannot start pager '%s'", pagercmd); |
|
211 | abortmsgerrno("cannot start pager '%s'", pagercmd); | |
211 | } |
|
212 | } |
@@ -15,7 +15,7 b'' | |||||
15 | void restoresignalhandler(void); |
|
15 | void restoresignalhandler(void); | |
16 | void setupsignalhandler(pid_t pid, pid_t pgid); |
|
16 | void setupsignalhandler(pid_t pid, pid_t pgid); | |
17 |
|
17 | |||
18 | pid_t setuppager(const char *pagercmd); |
|
18 | pid_t setuppager(const char *pagercmd, const char *envp[]); | |
19 | void waitpager(void); |
|
19 | void waitpager(void); | |
20 |
|
20 | |||
21 | #endif /* PROCUTIL_H_ */ |
|
21 | #endif /* PROCUTIL_H_ */ |
General Comments 0
You need to be logged in to leave comments.
Login now