Show More
@@ -373,8 +373,15 b' static int runinstructions(struct cmdser' | |||||
373 | } |
|
373 | } | |
374 |
|
374 | |||
375 | /* |
|
375 | /* | |
376 |
* Test whether the command is unsupported or not. |
|
376 | * Test whether the command and the environment is unsupported or not. | |
377 | * cover all cases. But it's fast, does not depend on the server. |
|
377 | * | |
|
378 | * If any of the stdio file descriptors are not present (rare, but some tools | |||
|
379 | * might spawn new processes without stdio instead of redirecting them to the | |||
|
380 | * null device), then mark it as not supported because attachio won't work | |||
|
381 | * correctly. | |||
|
382 | * | |||
|
383 | * The command list is not designed to cover all cases. But it's fast, and does | |||
|
384 | * not depend on the server. | |||
378 | */ |
|
385 | */ | |
379 | static int isunsupported(int argc, const char *argv[]) |
|
386 | static int isunsupported(int argc, const char *argv[]) | |
380 | { |
|
387 | { | |
@@ -384,6 +391,13 b' static int isunsupported(int argc, const' | |||||
384 | }; |
|
391 | }; | |
385 | unsigned int state = 0; |
|
392 | unsigned int state = 0; | |
386 | int i; |
|
393 | int i; | |
|
394 | /* use fcntl to test missing stdio fds */ | |||
|
395 | if (fcntl(STDIN_FILENO, F_GETFD) == -1 || | |||
|
396 | fcntl(STDOUT_FILENO, F_GETFD) == -1 || | |||
|
397 | fcntl(STDERR_FILENO, F_GETFD) == -1) { | |||
|
398 | debugmsg("stdio fds are missing"); | |||
|
399 | return 1; | |||
|
400 | } | |||
387 | for (i = 0; i < argc; ++i) { |
|
401 | for (i = 0; i < argc; ++i) { | |
388 | if (strcmp(argv[i], "--") == 0) |
|
402 | if (strcmp(argv[i], "--") == 0) | |
389 | break; |
|
403 | break; |
@@ -197,6 +197,14 b' in this test.' | |||||
197 |
|
197 | |||
198 | $ cd .. |
|
198 | $ cd .. | |
199 |
|
199 | |||
|
200 | missing stdio | |||
|
201 | ------------- | |||
|
202 | ||||
|
203 | $ CHGDEBUG=1 chg version -q 0<&- | |||
|
204 | chg: debug: * stdio fds are missing (glob) | |||
|
205 | chg: debug: * execute original hg (glob) | |||
|
206 | Mercurial Distributed SCM * (glob) | |||
|
207 | ||||
200 | server lifecycle |
|
208 | server lifecycle | |
201 | ---------------- |
|
209 | ---------------- | |
202 |
|
210 |
General Comments 0
You need to be logged in to leave comments.
Login now