X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/7dc251cf8ed990dd285b5fa5818c3a247e07d95c..803cf6668d9e89c244e5fbc7f996a460470338dd:/unitfork.pas?ds=sidebyside diff --git a/unitfork.pas b/unitfork.pas old mode 100755 new mode 100644 index cd008da..9e8503f --- a/unitfork.pas +++ b/unitfork.pas @@ -3,7 +3,9 @@ which is included in the package ----------------------------------------------------------------------------- } unit unitfork; - +{$ifdef fpc} + {$mode delphi} +{$endif} interface procedure dofork(const programname:string); @@ -17,7 +19,7 @@ uses {$ifdef VER1_0} linux, {$else} - baseunix,unix,unixutil, + baseunix,unix,unixutil,sockets, {$endif} sysutils; @@ -63,7 +65,11 @@ begin if ioresult <> 0 then exit; end; + {$IF FPC_FULLVERSION>=20602} + handle := getfilehandle(pidfile); + {$else} handle := getfs(pidfile); + {$endif} //debugout('got handle'); {check if locking is possible: it's not if other process still runs}