Skip to content

Commit 09ff998

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 273459 b: refs/heads/beta c: f88a1e6 h: refs/heads/master i: 273457: 1b5ea4c 273455: 816c53e
1 parent 287c2a9 commit 09ff998

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: aa7fe93d4a6217dd6f2538bce857ab6a097afbeb
26+
refs/heads/beta: f88a1e6f21c000f2d3b2e71778a7fa655cd8423c
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libstd/sys/unix/process.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -335,25 +335,25 @@ impl Command {
335335
// have the drop glue anyway because this code never returns (the
336336
// child will either exec() or invoke libc::exit)
337337
unsafe fn do_exec(&mut self, stdio: ChildPipes) -> io::Error {
338-
macro_rules! try {
338+
macro_rules! t {
339339
($e:expr) => (match $e {
340340
Ok(e) => e,
341341
Err(e) => return e,
342342
})
343343
}
344344

345345
if let Some(fd) = stdio.stdin.fd() {
346-
cvt_r(|| libc::dup2(fd, libc::STDIN_FILENO))?;
346+
t!(cvt_r(|| libc::dup2(fd, libc::STDIN_FILENO)));
347347
}
348348
if let Some(fd) = stdio.stdout.fd() {
349-
cvt_r(|| libc::dup2(fd, libc::STDOUT_FILENO))?;
349+
t!(cvt_r(|| libc::dup2(fd, libc::STDOUT_FILENO)));
350350
}
351351
if let Some(fd) = stdio.stderr.fd() {
352-
cvt_r(|| libc::dup2(fd, libc::STDERR_FILENO))?;
352+
t!(cvt_r(|| libc::dup2(fd, libc::STDERR_FILENO)));
353353
}
354354

355355
if let Some(u) = self.gid {
356-
cvt(libc::setgid(u as gid_t))?;
356+
t!(cvt(libc::setgid(u as gid_t)));
357357
}
358358
if let Some(u) = self.uid {
359359
// When dropping privileges from root, the `setgroups` call
@@ -365,7 +365,7 @@ impl Command {
365365
// privilege dropping function.
366366
let _ = libc::setgroups(0, ptr::null());
367367

368-
cvt(libc::setuid(u as uid_t))?;
368+
t!(cvt(libc::setuid(u as uid_t)));
369369
}
370370
if self.session_leader {
371371
// Don't check the error of setsid because it fails if we're the
@@ -374,7 +374,7 @@ impl Command {
374374
let _ = libc::setsid();
375375
}
376376
if let Some(ref cwd) = self.cwd {
377-
cvt(libc::chdir(cwd.as_ptr()))?;
377+
t!(cvt(libc::chdir(cwd.as_ptr())));
378378
}
379379
if let Some(ref envp) = self.envp {
380380
*sys::os::environ() = envp.as_ptr();
@@ -390,17 +390,17 @@ impl Command {
390390
// need to clean things up now to avoid confusing the program
391391
// we're about to run.
392392
let mut set: libc::sigset_t = mem::uninitialized();
393-
cvt(libc::sigemptyset(&mut set))?;
394-
cvt(libc::pthread_sigmask(libc::SIG_SETMASK, &set,
395-
ptr::null_mut()))?;
393+
t!(cvt(libc::sigemptyset(&mut set)));
394+
t!(cvt(libc::pthread_sigmask(libc::SIG_SETMASK, &set,
395+
ptr::null_mut())));
396396
let ret = libc::signal(libc::SIGPIPE, libc::SIG_DFL);
397397
if ret == libc::SIG_ERR {
398398
return io::Error::last_os_error()
399399
}
400400
}
401401

402402
for callback in self.closures.iter_mut() {
403-
callback()?;
403+
t!(callback());
404404
}
405405

406406
libc::execvp(self.argv[0], self.argv.as_ptr());

0 commit comments

Comments
 (0)