/[Sack]/trunk/lib/Sack/Pid.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Sack/Pid.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 132 by dpavlin, Wed Oct 7 17:27:43 2009 UTC revision 133 by dpavlin, Wed Oct 7 17:39:40 2009 UTC
# Line 13  sub port_pid { Line 13  sub port_pid {
13          my $pid_path = "/tmp/sack.$port.pid";          my $pid_path = "/tmp/sack.$port.pid";
14          if ( -e $pid_path ) {          if ( -e $pid_path ) {
15                  my $old_pid = read_file $pid_path;                  my $old_pid = read_file $pid_path;
16                  warn "[$port] kill old $old_pid from $pid\n";                  if ( $old_pid == $pid ) {
17                  kill 9, $old_pid;                          warn "[$port] pid $pid\n";
18                    } else {
19                            warn "[$port] kill old $old_pid from $pid\n";
20                            kill 9, $old_pid;
21                    }
22          }          }
23          write_file $pid_path, $pid;          write_file $pid_path, $pid;
24          warn "[$port] pid $pid\n";          warn "[$port] pid $pid\n";

Legend:
Removed from v.132  
changed lines
  Added in v.133

  ViewVC Help
Powered by ViewVC 1.1.26