Compare commits

...

No commits in common. "master" and "pristine-tar" have entirely different histories.

14 changed files with 1 additions and 203 deletions

View File

@ -1,5 +0,0 @@
MANIFEST
Makefile.PL
README
lib/Proc/Forkfunc.pm
t/fork.t

View File

@ -1,9 +0,0 @@
use ExtUtils::MakeMaker;
WriteMakefile(
'VERSION' => 96.042201,
'NAME' => 'Proc::Forkfunc',
'dist' => { COMPRESS=>"gzip", SUFFIX=>"gz" },
);

11
README
View File

@ -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
View File

@ -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
View File

@ -1 +0,0 @@
9

19
debian/control vendored
View File

@ -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
View File

@ -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
View File

@ -1,4 +0,0 @@
#!/usr/bin/make -f
%:
dh $@

View File

@ -1 +0,0 @@
3.0 (quilt)

2
debian/watch vendored
View File

@ -1,2 +0,0 @@
version=3
https://metacpan.org/release/Proc-Forkfunc .*/Proc-Forkfunc-v?(\d[\d.-]*)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$

View File

@ -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>

Binary file not shown.

View File

@ -0,0 +1 @@
8c7b6bc3eff65e684c106849f23ab28d65d22b3b

View File

@ -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");
}