-1st daemonize then single instance check call

This commit is contained in:
kingk85@gmail.com
2018-04-10 10:45:30 +01:00
parent 35be005379
commit 089c9bbed9

View File

@ -91,24 +91,24 @@ void configurationRead(ftpParameters_DataType *ftpParameters)
void applyConfiguration(ftpParameters_DataType *ftpParameters) void applyConfiguration(ftpParameters_DataType *ftpParameters)
{ {
if (ftpParameters->singleInstanceModeOn == 1) /* Fork the process daemon mode */
{ if (ftpParameters->daemonModeOn == 1)
int returnCode = isProcessAlreadyRunning(); {
if (returnCode == 1) daemonize("uFTP");
{ }
printf("\nThe process is already running..");
exit(0);
}
}
/* Fork the process daemon mode */ if (ftpParameters->singleInstanceModeOn == 1)
if (ftpParameters->daemonModeOn == 1) {
{ int returnCode = isProcessAlreadyRunning();
daemonize("uFTP");
} if (returnCode == 1)
{
printf("\nThe process is already running..");
exit(0);
}
}
} }
void initFtpData(ftpDataType *ftpData) void initFtpData(ftpDataType *ftpData)
{ {
int i; int i;