summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-04-13 11:28:16 +0000
committerfukachan <fukachan>2004-04-13 11:28:16 +0000
commit7f89249cac3201a19327726fb62f5f496fdb8952 (patch)
tree9d56842223a3195e282fe5bbe322e626d0223481 /fml/lib
parent70fc01704f3431d211f5a906e1689b67c449cc5c (diff)
downloadfml8-7f89249cac3201a19327726fb62f5f496fdb8952.tar.gz
fml8-7f89249cac3201a19327726fb62f5f496fdb8952.tar.bz2
fml8-7f89249cac3201a19327726fb62f5f496fdb8952.zip
implement rollback()
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/IPC/Queue.pm23
1 files changed, 22 insertions, 1 deletions
diff --git a/fml/lib/FML/IPC/Queue.pm b/fml/lib/FML/IPC/Queue.pm
index 657b2856..4f5dd01d 100644
--- a/fml/lib/FML/IPC/Queue.pm
+++ b/fml/lib/FML/IPC/Queue.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Queue.pm,v 1.4 2004/01/02 16:08:38 fukachan Exp $
+# $FML: Queue.pm,v 1.5 2004/04/12 15:32:05 fukachan Exp $
#
package FML::IPC::Queue;
@@ -202,6 +202,23 @@ sub _list_up_msg_in_queue_dir
}
+# Descriptions: roll back the status of files.
+# Arguments: OBJ($self)
+# Side Effects: chmod 0644 files.
+# Return Value: none
+sub rollback
+{
+ my ($self) = @_;
+ my $remove = $self->{ _remove_files } || [];
+
+ for my $f (@$remove) {
+ chmod 0644, $f;
+ }
+
+ $self->{ _remove_files } = [];
+}
+
+
=head1 UTILITY
=cut
@@ -287,6 +304,10 @@ if ($0 eq __FILE__) {
# dump.
use Data::Dumper;
print Dumper($list);
+
+ if (defined $ENV{ ROLLBACK } && $ENV{ ROLLBACK }) {
+ $q->rollback();
+ }
}