Files
harbour-core/harbour/contrib/hbunix/tests/testdmn.prg
Viktor Szakats fa950fae9c 2011-01-23 10:23 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
    ! Minor typo in help text.

  * utils/hbmk2/hbmk2.pt_BR.po
  * utils/hbmk2/hbmk2.hu_HU.po
  * utils/hbmk2/hbmk2.es_PE.po
    + Updated from source.

  * contrib/hbmxml/tests/rem.xml
  * contrib/hbmxml/tests/rem_err.xml
    ! Added missing EOL @ EOF.

  * contrib/hbunix/hbposix.h
    + Added generic macro to accept both logical and numeric type for
      boolean-like input parameters.

  * contrib/hbunix/tests/testdmn.prg
  * contrib/hbunix/daemon.c
    + UNIX_DAEMON(): Changed to accept numeric value for logical parameters.
    + UNIX_DAEMON(): Changed to return numeric value.
    ; Patch by Tamas.
2011-01-23 09:24:47 +00:00

43 lines
1.0 KiB
Plaintext

/*
* $Id$
*/
/*
* Harbour Project source code:
*
* Copyright 2011 Tamas TEVESZ <ice@extreme.hu>
* www - http://harbour-project.org
*
*/
REQUEST HB_GT_CGI_DEFAULT
PROCEDURE Main()
LOCAL cLogFile, cLogText
cLogFile := hb_ps() + CurDir() + hb_ps() + "testdmn.txt"
OutStd( hb_strFormat( "Parent(%d) launching child... ", posix_getpid() ) + hb_eol() )
IF unix_daemon( 0, 0 ) == -1
OutStd( hb_strFormat( "failed with errno=%d", posix_errno() ) + hb_eol() )
ErrorLevel( 1 )
QUIT
ENDIF
IF File( cLogFile )
FErase( cLogFile )
ENDIF
OutStd( "***" + hb_eol() + "* If you see this, something is b0rked" + hb_eol() + "***" + hb_eol() )
cLogText := hb_strFormat( "Hello, this is the daemon child(%d) writing.", posix_getpid() ) + hb_eol()
cLogText += hb_strFormat( "I am currenty residing in %s and ", hb_ps() + CurDir() ) + hb_eol()
cLogText += hb_strFormat( "am writing this message to %s", cLogFile ) + hb_eol()
cLogText += "Good bye now." + hb_eol()
hb_MemoWrit( cLogFile, cLogText )
RETURN