allow payment modification so we can import order_number info
[freeside.git] / fs_selfservice / FS-SelfService / freeside-selfservice-clientd
index a8b1e71..ce9e14d 100644 (file)
@@ -9,7 +9,7 @@ use subs qw(spawn logmsg lock_write unlock_write);
 use Fcntl qw(:flock);
 use POSIX qw(:sys_wait_h);
 use Socket;
-use Storable qw(nstore_fd fd_retrieve);
+use Storable 2.09 qw(nstore_fd fd_retrieve);
 use IO::Handle qw(_IONBF);
 use IO::Select;
 use IO::File;
@@ -145,22 +145,22 @@ while (1) {
         #handle some commands weirdly?
         $packet->{_token}=$$;
 
-        warn "[child-$$] locking write stream" if $Debug > 1;
+        warn "[child-$$] locking write stream\n" if $Debug > 1;
         lock_write;
 
-        warn "[child-$$] sending packet to remote server" if $Debug > 1;
+        warn "[child-$$] sending packet to remote server\n" if $Debug > 1;
         nstore_fd($packet, \*STDOUT) or die "FATAL: can't send response: $!";
         
-        warn "[child-$$] flushing write stream" if $Debug > 1;
+        warn "[child-$$] flushing write stream\n" if $Debug > 1;
         STDOUT->flush or die "FATAL: can't flush: $!";
         
-        warn "[child-$$] releasing write lock" if $Debug > 1;
+        warn "[child-$$] releasing write lock\n" if $Debug > 1;
         unlock_write;
 
-        warn "[child-$$] closing write stream" if $Debug > 1;
+        warn "[child-$$] closing write stream\n" if $Debug > 1;
         close STDOUT or die "FATAL: can't close write stream: $!"; #??!
 
-        warn "[child-$$] waiting for response from parent" if $Debug > 1;
+        warn "[child-$$] waiting for response from parent\n" if $Debug > 1;
         my $w = new IO::Select;
         $w->add(\*STDIN);
         until ( $w->can_read ) {
@@ -233,6 +233,7 @@ sub spawn {
 sub _logmsg {
   chomp( my $msg = shift );
   my $log = new IO::File ">>$log_file";
+  die "can't open $log_file: $!" unless defined($log);
   flock($log, LOCK_EX);
   seek($log, 0, 2);
   print $log "[client] [". scalar(localtime). "] [$$] $msg\n";