- # NFS-safe Locking per Linux open(2)
- my($hostname) = `hostname`;
- chomp($hostname);
- my($hitching_post) = "$opt{'gtmp-file'}.$hostname.$$";
- open(LOCK, ">$hitching_post") || die "$hitching_post: $!";
- close(LOCK);
- link($hitching_post, $opt{'gtmp-file'});
- if ((stat($hitching_post))[3] != 2) {
- close(OUT);
- unlink($hitching_post);
- &quit("group file locked -- giving up...");
- }
- unlink($hitching_post);
-# link($opt{'group-file'},$opt{'gtmp-file'}) || &quit("create gtmp: $!");