Skip to content

Commit

Permalink
fix _spawn_primitive to report error correctly (JuliaLang#34716)
Browse files Browse the repository at this point in the history
Method `_spawn_primitive` in `process.jl` seems to be defining a local valiable that shadows the `error` method that it tries to use.
This renames the local variable to fix that.
  • Loading branch information
tanmaykm committed Feb 12, 2020
1 parent f705905 commit 83fd1e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/process.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const SpawnIOs = Vector{Any} # convenience name for readability
for io in stdio]
handle = Libc.malloc(_sizeof_uv_process)
disassociate_julia_struct(handle) # ensure that data field is set to C_NULL
error = ccall(:jl_spawn, Int32,
err = ccall(:jl_spawn, Int32,
(Cstring, Ptr{Cstring}, Ptr{Cvoid}, Ptr{Cvoid},
Ptr{Tuple{Cint, UInt}}, Int,
UInt32, Ptr{Cstring}, Cstring, Ptr{Cvoid}),
Expand All @@ -94,9 +94,9 @@ const SpawnIOs = Vector{Any} # convenience name for readability
cmd.env === nothing ? C_NULL : cmd.env,
isempty(cmd.dir) ? C_NULL : cmd.dir,
uv_jl_return_spawn::Ptr{Cvoid})
if error != 0
if err != 0
ccall(:jl_forceclose_uv, Cvoid, (Ptr{Cvoid},), handle) # will call free on handle eventually
throw(_UVError("could not spawn " * repr(cmd), error))
throw(_UVError("could not spawn " * repr(cmd), err))
end
pp = Process(cmd, handle)
associate_julia_struct(handle, pp)
Expand Down

0 comments on commit 83fd1e8

Please sign in to comment.