Changeset 872 for LATMOS-Accounts
- Timestamp:
- 12/25/11 15:57:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts/bin/la-sync-manager
r861 r872 79 79 my $pid = fork; 80 80 if ($pid == 0) { 81 local $SIG{HUP} = 'IGNORE'; 81 82 $SIG{INT} = 'DEFAULT'; 82 83 my $res = $syncm->process_module($module, $baserev); 83 84 exit($res ? 0 : 1); 84 85 } 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; 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 } 93 97 } 98 $done = 1; 99 }; 100 while (!$done) { 101 sleep(1); 94 102 } 95 return 1;103 return !$res; 96 104 } 97 105
Note: See TracChangeset
for help on using the changeset viewer.