Commit 8eb6a358 authored by Cédric Boutillier's avatar Cédric Boutillier

Merge tag 'upstream/0.0.4'

Upstream version 0.0.4

# gpg: Signature faite le lun. 13 mai 2013 17:04:47 CEST avec la clef RSA d'identifiant 11E149E9
# gpg: Bonne signature de « Cédric Boutillier <boutil@debian.org> »
# gpg:                 alias « Cédric Boutillier <cedric.boutillier@upmc.fr> »
# gpg:                 alias « Cédric Boutillier <cedric.boutillier@polytechnique.org> »
# gpg:                 alias « Cédric Boutillier <cedric.boutillier@gmail.com> »
parents 24393cfd b316df46
......@@ -20,14 +20,16 @@ module Spoon
SIZE = FFI::Platform.mac? ? FFI.type_size(:pointer) : 128
def initialize
@pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), self.class)
@pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), Releaser)
error = LibC.posix_spawn_file_actions_init(@pointer)
raise SystemCallError.new("posix_file_actions_init", error) unless error == 0
end
def self.release(ptr)
LibC.posix_spawn_file_actions_destroy(ptr)
LibC.free(ptr)
class Releaser
def self.call(ptr)
LibC.posix_spawn_file_actions_destroy(ptr)
LibC.free(ptr)
end
end
def open(fd, path, oflag, mode)
......@@ -51,17 +53,19 @@ module Spoon
class SpawnAttributes
attr_reader :pointer
SIZE = FFI::Platform.mac? ? FFI.type_size(:pointer) : 128
SIZE = FFI::Platform.mac? ? FFI.type_size(:pointer) : 512
def initialize
@pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), self.class)
@pointer = FFI::AutoPointer.new(LibC.malloc(SIZE), Releaser)
error = LibC.posix_spawnattr_init(@pointer)
raise SystemCallError.new("posix_spawnattr_init", error) unless error == 0
end
def self.release(ptr)
LibC.posix_spawnattr_destroy(ptr)
LibC.free(ptr)
class Releaser
def self.call(ptr)
LibC.posix_spawnattr_destroy(ptr)
LibC.free(ptr)
end
end
def pgroup=(group)
......
--- !ruby/object:Gem::Specification
name: spoon
version: !ruby/object:Gem::Version
version: 0.0.3
prerelease:
version: 0.0.4
platform: ruby
authors:
- Charles Oliver Nutter
......
Gem::Specification.new do |s|
s.name = "spoon"
s.version = "0.0.3"
s.version = "0.0.4"
s.authors = ["Charles Oliver Nutter"]
s.date = "2013-03-29"
s.description = s.summary = "Spoon is an FFI binding of the posix_spawn function (and Windows equivalent), providing fork+exec functionality in a single shot."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment