X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/69b439a013e03cd1d3eb13da8bbbc20aa5bf5184..803cf6668d9e89c244e5fbc7f996a460470338dd:/unitfork.pas?ds=sidebyside diff --git a/unitfork.pas b/unitfork.pas old mode 100755 new mode 100644 index 5239fc0..9e8503f --- a/unitfork.pas +++ b/unitfork.pas @@ -1,9 +1,11 @@ -{ Copyright (C) 2005 Bas Steendijk and Peter Green - For conditions of distribution and use, see copyright notice in zlib_license.txt - which is included in the package - ----------------------------------------------------------------------------- } +{ Copyright (C) 2005 Bas Steendijk and Peter Green + For conditions of distribution and use, see copyright notice in zlib_license.txt + which is included in the package + ----------------------------------------------------------------------------- } unit unitfork; - +{$ifdef fpc} + {$mode delphi} +{$endif} interface procedure dofork(const programname:string); @@ -17,9 +19,9 @@ uses {$ifdef VER1_0} linux, {$else} - baseunix,unix,unixutil, + baseunix,unix,unixutil,sockets, {$endif} - sysutils; + sysutils; {$include unixstuff.inc} @@ -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}