Compare commits
No commits in common. "master" and "pristine-tar" have entirely different histories.
master
...
pristine-t
@ -1,9 +0,0 @@
|
||||
|
||||
use ExtUtils::MakeMaker;
|
||||
|
||||
WriteMakefile(
|
||||
'VERSION' => 96.042201,
|
||||
'NAME' => 'Proc::Forkfunc',
|
||||
'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" },
|
||||
);
|
||||
|
11
README
11
README
@ -1,11 +0,0 @@
|
||||
|
||||
This is a simple wrapper for fork. It will wait for there
|
||||
to be a process available. It will fork off a perl function.
|
||||
|
||||
To build/install it, use
|
||||
|
||||
perl Makefile.PL
|
||||
make
|
||||
make test
|
||||
make install
|
||||
|
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,5 +0,0 @@
|
||||
libproc-forkfunc-perl (96.042201-1) unstable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
-- Mario Fetka <mario.fetka@gmail.com> Fri, 15 Sep 2017 13:51:55 +0200
|
1
debian/compat
vendored
1
debian/compat
vendored
@ -1 +0,0 @@
|
||||
9
|
19
debian/control
vendored
19
debian/control
vendored
@ -1,19 +0,0 @@
|
||||
Source: libproc-forkfunc-perl
|
||||
Section: perl
|
||||
Priority: optional
|
||||
Maintainer: Mario Fetka <mario.fetka@gmail.com>
|
||||
Build-Depends: debhelper (>= 9)
|
||||
Build-Depends-Indep: perl
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: https://metacpan.org/release/Proc-Forkfunc
|
||||
|
||||
Package: libproc-forkfunc-perl
|
||||
Architecture: all
|
||||
Depends: ${misc:Depends}, ${perl:Depends}
|
||||
Description: Proc::Forkfunk -- fork off a function
|
||||
Fork off a process. Call a function on the child process the function should
|
||||
be passed in as a reference. The child function should not return.
|
||||
.
|
||||
Logic copied from somewhere, probably Larry Wall.
|
||||
.
|
||||
This description was automagically extracted from the module by dh-make-perl.
|
36
debian/copyright
vendored
36
debian/copyright
vendored
@ -1,36 +0,0 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Source: https://metacpan.org/release/Proc-Forkfunc
|
||||
Upstream-Contact: David Muir Sharnoff <muir@idiom.com>
|
||||
Upstream-Name: Proc-Forkfunc
|
||||
DISCLAIMER: This copyright info was automatically extracted
|
||||
from the perl module. It may not be accurate, so you better
|
||||
check the module sources in order to ensure the module for its
|
||||
inclusion in Debian or for general legal information. Please,
|
||||
if licensing information is incorrectly generated, file a bug
|
||||
on dh-make-perl.
|
||||
NOTE: Don't forget to remove this disclaimer once you are happy
|
||||
with this file.
|
||||
|
||||
Files: *
|
||||
Copyright: David Muir Sharnoff <muir@idiom.com>
|
||||
License:
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2017, Mario Fetka <mario.fetka@gmail.com>
|
||||
License: Artistic or GPL-1+
|
||||
|
||||
License: Artistic
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the Artistic License, which comes with Perl.
|
||||
.
|
||||
On Debian systems, the complete text of the Artistic License can be
|
||||
found in `/usr/share/common-licenses/Artistic'.
|
||||
|
||||
License: GPL-1+
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 1, or (at your option)
|
||||
any later version.
|
||||
.
|
||||
On Debian systems, the complete text of version 1 of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL-1'.
|
4
debian/rules
vendored
4
debian/rules
vendored
@ -1,4 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@
|
1
debian/source/format
vendored
1
debian/source/format
vendored
@ -1 +0,0 @@
|
||||
3.0 (quilt)
|
2
debian/watch
vendored
2
debian/watch
vendored
@ -1,2 +0,0 @@
|
||||
version=3
|
||||
https://metacpan.org/release/Proc-Forkfunc .*/Proc-Forkfunc-v?(\d[\d.-]*)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$
|
@ -1,67 +0,0 @@
|
||||
|
||||
package Proc::Forkfunc;
|
||||
|
||||
require Exporter;
|
||||
require POSIX;
|
||||
use Carp;
|
||||
|
||||
@ISA = (Exporter);
|
||||
@EXPORT = qw(forkfunc);
|
||||
|
||||
use vars qw($VERSION);
|
||||
$VERSION = 96.041701;
|
||||
|
||||
use strict;
|
||||
|
||||
sub forkfunc
|
||||
{
|
||||
my ($func, @args) = @_;
|
||||
|
||||
my $pid;
|
||||
|
||||
{
|
||||
if ($pid = fork()) {
|
||||
# parent
|
||||
return $pid;
|
||||
} elsif (defined $pid) {
|
||||
# child
|
||||
&$func(@args);
|
||||
croak "call to child returned\n";
|
||||
} elsif ($! == &POSIX::EAGAIN) {
|
||||
my $o0 = $0;
|
||||
$0 = "$o0: waiting to fork";
|
||||
sleep 5;
|
||||
$0 = $o0;
|
||||
redo;
|
||||
} else {
|
||||
croak "Can't fork: $!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Proc::Forkfunk -- fork off a function
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use Proc::Forkfunc;
|
||||
|
||||
forkfunc(\&child_func,@child_args);
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Fork off a process. Call a function on the child process
|
||||
the function should be passed in as a reference.
|
||||
The child function should not return.
|
||||
|
||||
Logic copied from somewhere, probably Larry Wall.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
David Muir Sharnoff <muir@idiom.com>
|
||||
|
BIN
libproc-forkfunc-perl_96.042201.orig.tar.gz.delta
Normal file
BIN
libproc-forkfunc-perl_96.042201.orig.tar.gz.delta
Normal file
Binary file not shown.
1
libproc-forkfunc-perl_96.042201.orig.tar.gz.id
Normal file
1
libproc-forkfunc-perl_96.042201.orig.tar.gz.id
Normal file
@ -0,0 +1 @@
|
||||
8c7b6bc3eff65e684c106849f23ab28d65d22b3b
|
43
t/fork.t
43
t/fork.t
@ -1,43 +0,0 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
|
||||
$| = 1;
|
||||
|
||||
print "1..4\n";
|
||||
|
||||
use Proc::Forkfunc;
|
||||
|
||||
forkfunc(sub { exit 1} );
|
||||
|
||||
&wok(1);
|
||||
|
||||
forkfunc(sub { exit $_[0] }, 2);
|
||||
|
||||
&wok(2);
|
||||
|
||||
forkfunc(\&pok3);
|
||||
|
||||
&wok(3);
|
||||
|
||||
forkfunc(\&pok, 4);
|
||||
|
||||
&wok(4);
|
||||
|
||||
sub pok3
|
||||
{
|
||||
exit 3;
|
||||
}
|
||||
|
||||
sub pok
|
||||
{
|
||||
exit $_[0];
|
||||
}
|
||||
|
||||
sub wok
|
||||
{
|
||||
my ($ws) = @_;
|
||||
|
||||
wait();
|
||||
my $st = $? >> 8;
|
||||
|
||||
print($st == $ws ? "ok $ws\n" : "not ok $ws\n");
|
||||
}
|
Loading…
Reference in New Issue
Block a user