… | |
… | |
371 | sub write_runtime { |
371 | sub write_runtime { |
372 | my $guard = cf::lock_acquire "write_runtime"; |
372 | my $guard = cf::lock_acquire "write_runtime"; |
373 | |
373 | |
374 | my $runtime = "$LOCALDIR/runtime"; |
374 | my $runtime = "$LOCALDIR/runtime"; |
375 | |
375 | |
|
|
376 | warn "starting to write runtime...\n";#d# |
376 | my $fh = aio_open "$runtime~", O_WRONLY | O_CREAT, 0644 |
377 | my $fh = aio_open "$runtime~", O_WRONLY | O_CREAT, 0644 |
377 | or return; |
378 | or return; |
378 | |
379 | |
379 | my $value = $cf::RUNTIME + 90 + 10; |
380 | my $value = $cf::RUNTIME + 90 + 10; |
380 | # 10 is the runtime save interval, for a monotonic clock |
381 | # 10 is the runtime save interval, for a monotonic clock |
… | |
… | |
390 | close $fh |
391 | close $fh |
391 | or return; |
392 | or return; |
392 | |
393 | |
393 | aio_rename "$runtime~", $runtime |
394 | aio_rename "$runtime~", $runtime |
394 | and return; |
395 | and return; |
|
|
396 | |
|
|
397 | warn "... done writing runtime.\n";#d# |
395 | |
398 | |
396 | 1 |
399 | 1 |
397 | } |
400 | } |
398 | |
401 | |
399 | =item cf::datalog type => key => value, ... |
402 | =item cf::datalog type => key => value, ... |