Changeset 915
- Timestamp:
- 03/15/12 14:35:08 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/bin/la-sync-manager
r897 r915 79 79 my $pid = fork; 80 80 if ($pid == 0) { 81 local $SIG{HUP} = 'IGNORE';82 81 $SIG{INT} = 'DEFAULT'; 83 82 my $res = $syncm->process_module($module, $baserev); 84 83 exit($res ? 0 : 1); 85 84 } 86 my $done = 0; 87 my $res = 0; 88 local $SIG{CHLD} = sub { 89 my $retpid = waitpid($pid, 0); 90 if ($retpid < 0) { 91 # no such process ?? 92 } elsif ($retpid) { 93 $res = $? >> 8; 94 if ($res) { 95 la_log LA_ERR, "Sync process exit with $res"; 96 } 85 my $retpid; 86 while(($retpid = waitpid(-1, 0)) <= 0) {} 87 local $SIG{HUP} = 'IGNORE'; 88 if ($retpid) { 89 my $res = $? >> 8; 90 if ($res) { 91 la_log LA_ERR, "Sync process exit with $res"; 92 return; 97 93 } 98 $done = 1;99 };100 while (!$done) {101 sleep(1);102 94 } 103 return !$res;95 return 1; 104 96 } 105 97
Note: See TracChangeset
for help on using the changeset viewer.