Skip to content

Commit

Permalink
Add /ui/bin to PATH when launching the first orbital application
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Jul 20, 2017
1 parent 65cde14 commit 0fee7f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::cell::RefCell;
use std::fs::File;
use std::io::{Error, Result};
use std::os::unix::io::{AsRawFd, FromRawFd};
use std::path::PathBuf;
use std::process::Command;
use std::rc::Rc;
use syscall::flag::{O_CLOEXEC, O_CREAT, O_NONBLOCK, O_RDWR};
Expand All @@ -43,6 +44,14 @@ fn main() {

env::set_var("DISPLAY", &display_path);

{
let path = env::var("PATH").unwrap_or(String::new());
let mut paths = env::split_paths(&path).collect::<Vec<_>>();
paths.push(PathBuf::from("/ui/bin"));
let new_path = env::join_paths(paths).unwrap();
env::set_var("PATH", new_path);
}

let socket_res = syscall::open(":orbital", O_CREAT | O_CLOEXEC | O_NONBLOCK | O_RDWR)
.map(|socket| unsafe { File::from_raw_fd(socket) })
.map_err(|err| Error::from_raw_os_error(err.errno));
Expand Down

0 comments on commit 0fee7f4

Please sign in to comment.