Snap for 8730993 from 292f8f278dc315ac045d030ccccce60e49342b9a to mainline-tzdata3-release

Change-Id: Id9ef1c050c5fc9714bb4e78631d68a3123c873f8
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index ea16222..a082427 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "ed1c4f6eed646608390a4130bb6de78d630a7b0f"
+    "sha1": "9ff8c8e9d6dc8da25a7f7947f4488ceecdffa553"
   }
 }
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 8a05d56..0000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-name: tests
-
-on:
-  push:
-    branches:
-      - "*"
-    # not on tags
-  pull_request:
-
-env:
-  RUSTFLAGS: "-D warnings"
-  RUST_BACKTRACE: "1"
-
-jobs:
-  cargo_tests:
-    name: ${{ matrix.os }} ${{ matrix.rust_channel }}
-    runs-on: ${{ matrix.os }}
-    strategy:
-      fail-fast: false
-      matrix:
-        os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
-        rust_channel: [stable, beta, nightly]
-
-    steps:
-    - uses: actions/checkout@v1
-    - uses: actions-rs/toolchain@v1
-      with:
-        toolchain: ${{ matrix.rust_channel }}
-        profile: minimal
-        override: true
-    - run: cargo test
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..0d4ad53
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,8 @@
+language: rust
+os:
+  - linux
+  - osx
+rust:
+  - stable
+  - beta
+  - nightly
diff --git a/Android.bp b/Android.bp
index 60a4abd..72212d4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -22,8 +22,6 @@
     name: "libshared_child",
     host_supported: true,
     crate_name: "shared_child",
-    cargo_env_compat: true,
-    cargo_pkg_version: "1.0.0",
     srcs: ["src/lib.rs"],
     edition: "2018",
     rustlibs: [
@@ -31,25 +29,34 @@
     ],
     apex_available: [
         "//apex_available:platform",
-        "com.android.compos",
         "com.android.virt",
     ],
 }
 
-rust_test {
-    name: "shared_child_test_src_lib",
-    host_supported: true,
+rust_defaults {
+    name: "shared_child_defaults",
     crate_name: "shared_child",
-    cargo_env_compat: true,
-    cargo_pkg_version: "1.0.0",
     srcs: ["src/lib.rs"],
     test_suites: ["general-tests"],
     auto_gen_config: true,
-    test_options: {
-        unit_test: true,
-    },
     edition: "2018",
     rustlibs: [
         "liblibc",
     ],
 }
+
+rust_test_host {
+    name: "shared_child_host_test_src_lib",
+    defaults: ["shared_child_defaults"],
+    test_options: {
+        unit_test: true,
+    },
+}
+
+rust_test {
+    name: "shared_child_device_test_src_lib",
+    defaults: ["shared_child_defaults"],
+}
+
+// dependent_library ["feature_list"]
+//   libc-0.2.94 "default,std"
diff --git a/Cargo.toml b/Cargo.toml
index d13367c..75e890b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,16 +3,17 @@
 # When uploading crates to the registry Cargo will automatically
 # "normalize" Cargo.toml files for maximal compatibility
 # with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies.
+# to registry (e.g., crates.io) dependencies
 #
-# If you are reading this file be aware that the original Cargo.toml
-# will likely look very different (and much more reasonable).
-# See Cargo.toml.orig for the original contents.
+# If you believe there's an error in this file please file an
+# issue against the rust-lang/cargo repository. If you're
+# editing this file be aware that the upstream Cargo.toml
+# will likely look very different (and much more reasonable)
 
 [package]
 edition = "2018"
 name = "shared_child"
-version = "1.0.0"
+version = "0.3.5"
 authors = ["jacko"]
 description = "a library for using child processes from multiple threads"
 documentation = "https://docs.rs/shared_child"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 2453bc6..5c8ea27 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,6 +1,6 @@
 [package]
 name = "shared_child"
-version = "1.0.0"
+version = "0.3.5"
 authors = ["jacko"]
 license = "MIT"
 repository = "https://github.com/oconnor663/shared_child.rs"
diff --git a/METADATA b/METADATA
index 029d963..2c67826 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/shared_child/shared_child-1.0.0.crate"
+    value: "https://static.crates.io/crates/shared_child/shared_child-0.3.5.crate"
   }
-  version: "1.0.0"
+  version: "0.3.5"
   license_type: NOTICE
   last_upgrade_date {
-    year: 2022
-    month: 3
-    day: 1
+    year: 2021
+    month: 4
+    day: 13
   }
 }
diff --git a/README.md b/README.md
index b08106d..94525fa 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# shared_child.rs [![Actions Status](https://github.com/oconnor663/shared_child.rs/workflows/tests/badge.svg)](https://github.com/oconnor663/shared_child.rs/actions) [![crates.io](https://img.shields.io/crates/v/shared_child.svg)](https://crates.io/crates/shared_child) [![docs.rs](https://docs.rs/shared_child/badge.svg)](https://docs.rs/shared_child)
+# shared_child.rs [![Travis build](https://travis-ci.org/oconnor663/shared_child.rs.svg?branch=master)](https://travis-ci.org/oconnor663/shared_child.rs) [![Build status](https://ci.appveyor.com/api/projects/status/900ckow3c5awq3t5/branch/master?svg=true)](https://ci.appveyor.com/project/oconnor663/shared-child-rs/branch/master) [![crates.io](https://img.shields.io/crates/v/shared_child.svg)](https://crates.io/crates/shared_child) [![docs.rs](https://docs.rs/shared_child/badge.svg)](https://docs.rs/shared_child)
 
 A library for awaiting and killing child processes from multiple threads.
 
diff --git a/README.tpl b/README.tpl
index c16ee7f..3ad7e39 100644
--- a/README.tpl
+++ b/README.tpl
@@ -1,3 +1,3 @@
-# {{crate}}.rs [![Actions Status](https://github.com/oconnor663/shared_child.rs/workflows/tests/badge.svg)](https://github.com/oconnor663/shared_child.rs/actions) [![crates.io](https://img.shields.io/crates/v/shared_child.svg)](https://crates.io/crates/shared_child) [![docs.rs](https://docs.rs/shared_child/badge.svg)](https://docs.rs/shared_child)
+# {{crate}}.rs [![Travis build](https://travis-ci.org/oconnor663/shared_child.rs.svg?branch=master)](https://travis-ci.org/oconnor663/shared_child.rs) [![Build status](https://ci.appveyor.com/api/projects/status/900ckow3c5awq3t5/branch/master?svg=true)](https://ci.appveyor.com/project/oconnor663/shared-child-rs/branch/master) [![crates.io](https://img.shields.io/crates/v/shared_child.svg)](https://crates.io/crates/shared_child) [![docs.rs](https://docs.rs/shared_child/badge.svg)](https://docs.rs/shared_child)
 
 {{readme}}
diff --git a/TEST_MAPPING b/TEST_MAPPING
index 078d2ff..22f1cfe 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -2,18 +2,7 @@
 {
   "presubmit": [
     {
-      "name": "shared_child_test_src_lib"
-    },
-    {
-      "name": "virtualizationservice_device_test"
-    }
-  ],
-  "presubmit-rust": [
-    {
-      "name": "shared_child_test_src_lib"
-    },
-    {
-      "name": "virtualizationservice_device_test"
+      "name": "shared_child_device_test_src_lib"
     }
   ]
 }
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..354716e
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,32 @@
+environment:
+  matrix:
+  - TARGET: x86_64-pc-windows-msvc
+    VERSION: 1.31.0
+  - TARGET: i686-pc-windows-msvc
+    VERSION: 1.31.0
+  - TARGET: i686-pc-windows-gnu
+    VERSION: 1.31.0
+  - TARGET: x86_64-pc-windows-msvc
+    VERSION: beta
+  - TARGET: i686-pc-windows-msvc
+    VERSION: beta
+  - TARGET: i686-pc-windows-gnu
+    VERSION: beta
+  - TARGET: x86_64-pc-windows-msvc
+    VERSION: nightly
+  - TARGET: i686-pc-windows-msvc
+    VERSION: nightly
+  - TARGET: i686-pc-windows-gnu
+    VERSION: nightly
+install:
+  - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-${env:VERSION}-${env:TARGET}.exe"
+  - rust-%VERSION%-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
+  - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
+  - SET PATH=%PATH%;C:\MinGW\bin
+  - rustc -V
+  - cargo -V
+
+build: false
+
+test_script:
+  - cargo test --verbose
diff --git a/cargo2android.json b/cargo2android.json
index 0e54308..ac56e26 100644
--- a/cargo2android.json
+++ b/cargo2android.json
@@ -1,11 +1,10 @@
 {
   "apex-available": [
     "//apex_available:platform",
-    "com.android.compos",
     "com.android.virt"
   ],
   "dependencies": true,
   "device": true,
   "run": true,
   "tests": true
-}
+}
\ No newline at end of file
diff --git a/src/lib.rs b/src/lib.rs
index 5c4f200..58c1e0c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -62,7 +62,7 @@
 //! ```
 
 use std::io;
-use std::process::{Child, ChildStderr, ChildStdin, ChildStdout, Command, ExitStatus};
+use std::process::{Child, Command, ExitStatus};
 use std::sync::{Condvar, Mutex};
 
 mod sys;
@@ -85,36 +85,16 @@
 }
 
 impl SharedChild {
-    /// Spawn a new `SharedChild` from a
-    /// [`std::process::Command`](https://doc.rust-lang.org/std/process/struct.Command.html).
-    pub fn spawn(command: &mut Command) -> io::Result<Self> {
+    /// Spawn a new `SharedChild` from a `std::process::Command`.
+    pub fn spawn(command: &mut Command) -> io::Result<SharedChild> {
         let child = command.spawn()?;
-        Ok(Self {
+        Ok(SharedChild {
             child: Mutex::new(child),
             state_lock: Mutex::new(NotWaiting),
             state_condvar: Condvar::new(),
         })
     }
 
-    /// Construct a new `SharedChild` from an already spawned
-    /// [`std::process::Child`](https://doc.rust-lang.org/std/process/struct.Child.html).
-    ///
-    /// This constructor needs to know whether `child` has already been waited on, and the only way
-    /// to find that out is to call `child.try_wait()` internally. If the child process is
-    /// currently a zombie, that call will clean it up as a side effect. The [`SharedChild::spawn`]
-    /// constructor doesn't need to do this.
-    pub fn new(mut child: Child) -> io::Result<Self> {
-        let state = match child.try_wait()? {
-            Some(status) => Exited(status),
-            None => NotWaiting,
-        };
-        Ok(Self {
-            child: Mutex::new(child),
-            state_lock: Mutex::new(state),
-            state_condvar: Condvar::new(),
-        })
-    }
-
     /// Return the child process ID.
     pub fn id(&self) -> u32 {
         self.child.lock().unwrap().id()
@@ -224,46 +204,15 @@
         self.child.lock().unwrap().kill()
     }
 
-    /// Consume the `SharedChild` and return the
-    /// [`std::process::Child`](https://doc.rust-lang.org/std/process/struct.Child.html)
-    /// it contains.
+    /// Consume the `SharedChild` and return the `std::process::Child` it
+    /// contains.
     ///
-    /// We never reap the child process except by calling `wait` or `try_wait`
-    /// on it, so the child object's inner state is correct, even if it was
-    /// waited on while it was shared.
+    /// We never reap the child process except through `Child::wait`, so the
+    /// child object's inner state is correct, even if it was waited on while it
+    /// was shared.
     pub fn into_inner(self) -> Child {
         self.child.into_inner().unwrap()
     }
-
-    /// Take the child's
-    /// [`stdin`](https://doc.rust-lang.org/std/process/struct.Child.html#structfield.stdin)
-    /// handle, if any.
-    ///
-    /// This will only return `Some` the first time it's called, and then only if the `Command`
-    /// that created the child was configured with `.stdin(Stdio::piped())`.
-    pub fn take_stdin(&self) -> Option<ChildStdin> {
-        self.child.lock().unwrap().stdin.take()
-    }
-
-    /// Take the child's
-    /// [`stdout`](https://doc.rust-lang.org/std/process/struct.Child.html#structfield.stdout)
-    /// handle, if any.
-    ///
-    /// This will only return `Some` the first time it's called, and then only if the `Command`
-    /// that created the child was configured with `.stdout(Stdio::piped())`.
-    pub fn take_stdout(&self) -> Option<ChildStdout> {
-        self.child.lock().unwrap().stdout.take()
-    }
-
-    /// Take the child's
-    /// [`stderr`](https://doc.rust-lang.org/std/process/struct.Child.html#structfield.stderr)
-    /// handle, if any.
-    ///
-    /// This will only return `Some` the first time it's called, and then only if the `Command`
-    /// that created the child was configured with `.stderr(Stdio::piped())`.
-    pub fn take_stderr(&self) -> Option<ChildStderr> {
-        self.child.lock().unwrap().stderr.take()
-    }
 }
 
 #[derive(Debug)]
@@ -277,9 +226,9 @@
 
 #[cfg(test)]
 mod tests {
-    use super::*;
-    use std::error::Error;
-    use std::process::{Command, Stdio};
+    use super::{sys, SharedChild};
+    use std;
+    use std::process::Command;
     use std::sync::Arc;
 
     // Python isn't available on some Unix platforms, e.g. Android, so we need this instead.
@@ -295,7 +244,6 @@
         cmd
     }
 
-    // Python isn't available on some Unix platforms, e.g. Android, so we need this instead.
     #[cfg(unix)]
     pub fn sleep_forever_cmd() -> Command {
         let mut cmd = Command::new("sleep");
@@ -310,19 +258,6 @@
         cmd
     }
 
-    // Python isn't available on some Unix platforms, e.g. Android, so we need this instead.
-    #[cfg(unix)]
-    pub fn cat_cmd() -> Command {
-        Command::new("cat")
-    }
-
-    #[cfg(not(unix))]
-    pub fn cat_cmd() -> Command {
-        let mut cmd = Command::new("python");
-        cmd.arg("-c").arg("");
-        cmd
-    }
-
     #[test]
     fn test_wait() {
         let child = SharedChild::spawn(&mut true_cmd()).unwrap();
@@ -410,55 +345,4 @@
         // But wait should succeed.
         child.wait().unwrap();
     }
-
-    #[test]
-    fn test_new() -> Result<(), Box<dyn Error>> {
-        // Spawn a short-lived child.
-        let mut command = cat_cmd();
-        command.stdin(Stdio::piped());
-        command.stdout(Stdio::null());
-        let mut child = command.spawn()?;
-        let child_stdin = child.stdin.take().unwrap();
-
-        // Construct a SharedChild from the Child, which has not yet been waited on. The child is
-        // blocked on stdin, so we know it hasn't yet exited.
-        let mut shared_child = SharedChild::new(child).unwrap();
-        assert!(matches!(
-            *shared_child.state_lock.lock().unwrap(),
-            NotWaiting,
-        ));
-
-        // Now close the child's stdin. This will cause the child to exit.
-        drop(child_stdin);
-
-        // Construct more SharedChild objects from the same child, in a loop. Eventually one of
-        // them will notice that the child has exited.
-        loop {
-            shared_child = SharedChild::new(shared_child.into_inner())?;
-            if let Exited(status) = &*shared_child.state_lock.lock().unwrap() {
-                assert!(status.success());
-                return Ok(());
-            }
-        }
-    }
-
-    #[test]
-    fn test_takes() -> Result<(), Box<dyn Error>> {
-        let mut command = true_cmd();
-        command.stdin(Stdio::piped());
-        command.stdout(Stdio::piped());
-        command.stderr(Stdio::piped());
-        let shared_child = SharedChild::spawn(&mut command)?;
-
-        assert!(shared_child.take_stdin().is_some());
-        assert!(shared_child.take_stdout().is_some());
-        assert!(shared_child.take_stderr().is_some());
-
-        assert!(shared_child.take_stdin().is_none());
-        assert!(shared_child.take_stdout().is_none());
-        assert!(shared_child.take_stderr().is_none());
-
-        shared_child.wait()?;
-        Ok(())
-    }
 }
diff --git a/src/sys/unix.rs b/src/sys/unix.rs
index abdfa48..400f910 100644
--- a/src/sys/unix.rs
+++ b/src/sys/unix.rs
@@ -48,6 +48,9 @@
         //   invocation, then check for a non-zero value afterwards.
         //
         // https://github.com/opensource-apple/xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/kern/kern_exit.c#L2150-L2156
+        //
+        // XXX: The siginfo_t struct has padding. Does that make it unsound to
+        // initialize it this way?
         siginfo = std::mem::zeroed();
         libc::waitid(
             libc::P_PID,