$OpenBSD: patch-src_libstd_sys_unix_os_rs,v 1.2 2016/06/09 04:20:10 semarie Exp $
argv0 isn't suitable as current_exe() in all cases.
--- src/libstd/sys/unix/os.rs.orig	Mon May 23 18:29:00 2016
+++ src/libstd/sys/unix/os.rs	Tue Jun  7 17:36:10 2016
@@ -235,13 +235,14 @@ pub fn current_exe() -> io::Result<PathBuf> {
         argv.set_len(argv_len as usize);
         if argv[0].is_null() {
             return Err(io::Error::new(io::ErrorKind::Other,
-                                      "no current exe available"))
+                                      "no current exe available (null)"))
         }
         let argv0 = CStr::from_ptr(argv[0]).to_bytes();
         if argv0[0] == b'.' || argv0.iter().any(|b| *b == b'/') {
             ::fs::canonicalize(OsStr::from_bytes(argv0))
         } else {
-            Ok(PathBuf::from(OsStr::from_bytes(argv0)))
+            Err(io::Error::new(io::ErrorKind::Other,
+                               "no current exe available (short)"))
         }
     }
 }
