Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual

Page 276

Advertising
background image

KTD-S0057-I

Page 272 Linux® Programming Examples (DebianTM)


KTAM3874/pITX Software Guide


int main (void)
{

.

.

if (create_pidfile ())

ERROR;

.


There is evidence that the create_pidfile() call should be made before you fork off the parent process.
Naturally you have to close the file descriptor 'pidfile' at the end of the program and in the signal handler
(SIGTERM). If you use the '

exit

' command you should also delete the physical pidfile in the server appli-

cation otherwise you can add an '

rm

' command in the stop-path of the init script.


Advertising
This manual is related to the following products: