Commit graph

214 commits

Author SHA1 Message Date
kennytm
cefdd6d5e9
Rollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrum
std: Child::kill() returns error if process has already exited

This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.
2018-04-24 11:56:59 +08:00
Andreas Tolfsen
bc4bd5642a fixup! std: Child::kill() returns error if process has already exited 2018-04-17 08:00:48 +01:00
Andreas Tolfsen
fd2afa01aa fixup! std: Child::kill() returns error if process has already exited 2018-04-08 16:20:15 +01:00
Alex Crichton
323f808791 std: Inline some Termination-related methods
These were showing up in tests and in binaries but are trivially optimize-able
away, so add `#[inline]` attributes so LLVM has an opportunity to optimize them
out.
2018-04-05 11:07:19 -07:00
Thayne McCombs
9ab5788e0e Fix "since" version for getpid feature.
It was stabilized right before the beta branch was cut for 1.26.0.

See https://github.com/rust-lang/rust/pull/49523#issuecomment-377996315
2018-04-02 19:34:06 -06:00
Thayne McCombs
d4f5e89ee0 Stabilize std::process::id()
Fixes #44971
2018-04-01 21:40:56 -06:00
Andreas Tolfsen
51dc6304e7 fixup! std: Child::kill() returns error if process has already exited 2018-03-29 18:10:40 +01:00
Andreas Tolfsen
d541282d6c fixup! std: Child::kill() returns error if process has already exited 2018-03-28 23:05:51 +01:00
Andreas Tolfsen
7eb9a091f3 std: Child::kill() returns error if process has already exited
This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.
2018-03-28 18:54:34 +01:00
Alexander Ronald Altman
f9661126ca Minor formatting consistency fix. 2018-03-25 01:27:45 -05:00
Tyler Mandry
2b13d95da0 termination_trait: Make error message more helpful 2018-03-21 23:28:48 -05:00
Tyler Mandry
b6934c91b2 termination_trait: Put examples in error help, not label 2018-03-21 13:32:46 -05:00
Tyler Mandry
94bdeb64f9 termination_trait: Add () example to error message 2018-03-21 00:26:00 -05:00
Scott McMurray
74c5c6e6cb Move process::ExitCode internals to sys
Now begins the saga of fixing compilation errors on other platforms...
2018-03-03 18:44:44 -08:00
Scott McMurray
2ce2b40ee5 Fix linkchecker 2018-02-28 23:34:20 -08:00
Scott McMurray
fc2e4e7833 Put some thought and documentation effort into process::ExitCode 2018-02-27 10:31:17 -08:00
Scott McMurray
e20f7b2ea7 Restrict the Termination impls to simplify stabilization
Make a minimal commitment for stabilization.  More impls are likely in future, but are not necessary at this time.
2018-02-24 23:51:08 -08:00
Niko Matsakis
5f1e78f19a move Termination trait to std::process 2018-02-22 17:57:08 -05:00
Corentin Henry
077d3434aa add test checking that process::Command is Send 2018-01-26 08:21:58 -08:00
Ed Schouten
d9d97c9f09 Make tests build on CloudABI.
There are some tests that need to be disabled on CloudABI specifically,
due to the fact that the shims cannot be built in combination with
unix::ext or windows::ext. Also improve the scoping of some imports to
suppress compiler warnings.
2018-01-11 11:28:34 +01:00
Loïc Damien
8fc4a24062
Fix an error in std::process documentation 2018-01-04 22:01:57 +01:00
kennytm
4ababefc55 Rollup merge of #46943 - malbarbo:process-test-busybox, r=alexcrichton
Fix process test when using busybox mkdir

busybox mkdir . returns 0
busybox mkdir ./ returns 1
2017-12-26 15:18:59 +08:00
Diggory Blake
ccc91d7b48 Capture environment at spawn 2017-12-24 14:24:31 +00:00
Marco A L Barbosa
dc71cab4df Fix process test when using busybox mkdir
busybox mkdir . returns 0
busybox mkdir ./ returns 1
2017-12-22 08:21:05 -02:00
Corey Farwell
2178e3a1b9 Clarify stdin behavior of Command::output.
Fixes #44929.
2017-11-22 20:47:31 -05:00
bors
7d475a28df Auto merge of #45295 - Technius:docs/process, r=steveklabnik
Improve std::process module docs

Addresses part of #29370

I've changed the first `cat` example to a "Hello World" example involving echo, and I've also added another example showing how to pipe output. I'm still working on the module-level description.

For now, I'd like feedback on the examples.

r? @steveklabnik
2017-10-29 06:24:20 +00:00
Bryan Tan
84ab6aec43 Add no_run to process examples involving unix commands 2017-10-28 20:27:05 -07:00
kennytm
bea6136b4a Rollup merge of #45059 - tmccombs:pid, r=alexcrichton
Add current_pid function

Fixes #44971
2017-10-26 03:02:48 +08:00
steveklabnik
f8f9005e57 Fix most rendering warnings from switching to CommonMark 2017-10-20 15:29:35 -04:00
Bryan Tan
3566832ef3 Add child process IO handling docs 2017-10-17 17:49:02 -07:00
kennytm
18f289559e Rollup merge of #45151 - Pirh:stdio_default_docs, r=frewsxcv
Document defaults for stdin, stdout, and stderr methods of Command

For #29370
2017-10-17 22:20:57 +08:00
Bryan Tan
f67f6622b3 Create section on how to spawn processes; change module description 2017-10-15 19:45:07 -07:00
Bryan Tan
bb74b13b74 Fix std::process hello world example 2017-10-15 13:11:14 -07:00
kennytm
430ac4ba50 Rollup merge of #45113 - Pirh:process_output_links, r=steveklabnik
Link std::process::Output to Command and Child

As per #29370
2017-10-15 14:21:51 +08:00
Bryan Tan
e788e90bad Fixed accidental deletion of colon 2017-10-14 20:41:58 -07:00
Bryan Tan
5243a98b48 Add a brief description and two examples to std::process 2017-10-14 19:19:19 -07:00
Pirh
8c4a68dca1 Add line break after summary of process::Output 2017-10-13 18:18:09 +01:00
Pirh
210c91100f Remove misleading line on Windows Subsystem stdio 2017-10-10 17:58:13 +01:00
bors
5f578dfad0 Auto merge of #45141 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

- Successful merges: #44962, #45051, #45091, #45106, #45117, #45118, #45120, #45125, #45136
- Failed merges:
2017-10-10 08:30:10 +00:00
bors
13ae187043 Auto merge of #44822 - frewsxcv:frewsxcv-eprintln, r=Kimundi
Migrate to eprint/eprintln macros where appropriate.

None
2017-10-10 02:54:14 +00:00
Pirh
6f653bb1b1 Document defaults for stdin, stdout, and stderr methods of Command 2017-10-09 19:20:07 +01:00
Pirh
32c4b71471 Link std::process::Output to Command and Child 2017-10-08 22:16:09 +01:00
Pirh
977200310a Remove ./ prefix from relative URLs
Also remove trailing whitespace to pass tidy checks.
2017-10-08 19:09:16 +01:00
Pirh
19029d5627 Add links and examples for std::process::Stdio
As per #29370
2017-10-08 17:12:14 +01:00
Thayne McCombs
29b319b6b2 Change current_pid to just id. 2017-10-07 20:59:58 -06:00
Thayne McCombs
ba7575886e Add missing colon. 2017-10-07 00:55:58 -06:00
Thayne McCombs
6ff6b93560 Add current_pid function
Fixes #44971
2017-10-06 01:15:49 -06:00
Pirh
28ef0d1085 Document that process::abort will not call the panic hook 2017-10-02 19:59:50 +01:00
Corey Farwell
8ef5447815 Migrate to eprint/eprintln macros where appropriate. 2017-09-28 11:38:35 -04:00
Pirh
7ab20c850e Explain difference between panic! and abort in abort docs
As per #29370
2017-09-27 22:47:21 +01:00