Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
7aba72ba
Commit
7aba72ba
authored
Feb 29, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os: diagnose chdir error during StartProcess
R=golang-dev, bradfitz CC=golang-dev
https://golang.org/cl/5711044
parent
b47cef39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
src/pkg/os/exec_posix.go
src/pkg/os/exec_posix.go
+10
-0
No files found.
src/pkg/os/exec_posix.go
View file @
7aba72ba
...
...
@@ -18,6 +18,16 @@ import (
//
// If there is an error, it will be of type *PathError.
func
StartProcess
(
name
string
,
argv
[]
string
,
attr
*
ProcAttr
)
(
p
*
Process
,
err
error
)
{
// Double-check existence of the directory we want
// to chdir into. We can make the error clearer this way.
if
attr
!=
nil
&&
attr
.
Dir
!=
""
{
if
_
,
err
:=
Stat
(
attr
.
Dir
);
err
!=
nil
{
pe
:=
err
.
(
*
PathError
)
pe
.
Op
=
"chdir"
return
nil
,
pe
}
}
sysattr
:=
&
syscall
.
ProcAttr
{
Dir
:
attr
.
Dir
,
Env
:
attr
.
Env
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment