{
if (daemon->applications[i].user_handle==fd)
{
- daemon->applications[i].user_handle = 0;
+ daemon->applications[i].user_handle = DLT_FD_INIT;
}
}
application->pid = pid;
application->application_description = 0;
application->num_contexts = 0;
- application->user_handle = -1;
+ application->user_handle = DLT_FD_INIT;
new_application = 1;
}
}
- if( application->user_handle != -1 )
+ if( application->user_handle != DLT_FD_INIT )
{
if( application->pid != pid )
{
dlt_log(LOG_ERR, str);
}
- application->user_handle = -1;
+ application->user_handle = DLT_FD_INIT;
application->pid = pid;
}
}
/* open user pipe only if it is not yet opened */
- if (application->user_handle==-1 && pid!=0)
+ if (application->user_handle==DLT_FD_INIT && pid!=0)
{
sprintf(filename,"%s/dlt%d",DLT_USER_DIR,application->pid);
if (daemon->num_applications>0)
{
/* Check if user handle is open; if yes, close it */
- if (application->user_handle!=-1)
+ if (application->user_handle >= DLT_FD_MINIMUM)
{
close(application->user_handle);
- application->user_handle=-1;
+ application->user_handle=DLT_FD_INIT;
}
/* Free description of application to be deleted */
{
if (daemon->contexts[i].user_handle==fd)
{
- daemon->contexts[i].user_handle = 0;
+ daemon->contexts[i].user_handle = DLT_FD_INIT;
}
}
{
/* Close connection */
close(context->user_handle);
- context->user_handle=0;
+ context->user_handle=DLT_FD_INIT;
}
}
{
/* Close connection */
close(app->user_handle);
- app->user_handle=0;
+ app->user_handle=DLT_FD_INIT;
}
}
{
/* Close connection */
close(context->user_handle);
- context->user_handle=0;
+ context->user_handle=DLT_FD_INIT;
}
dlt_daemon_control_service_response(sock, daemon, id, DLT_SERVICE_RESPONSE_ERROR, verbose);
}
old_log_level = context->log_level;
context->log_level = req->log_level; /* No endianess conversion necessary*/
- if ((context->user_handle!=0) &&
+ if ((context->user_handle >= DLT_FD_MINIMUM) &&
(dlt_daemon_user_send_log_level(daemon, context, verbose)==0))
{
dlt_daemon_control_service_response(sock, daemon, id, DLT_SERVICE_RESPONSE_OK, verbose);
old_trace_status = context->trace_status;
context->trace_status = req->log_level; /* No endianess conversion necessary */
- if ((context->user_handle!=0) &&
+ if ((context->user_handle >= DLT_FD_MINIMUM ) &&
(dlt_daemon_user_send_log_level(daemon, context, verbose)==0))
{
dlt_daemon_control_service_response(sock, daemon, id, DLT_SERVICE_RESPONSE_OK, verbose);
if ((context->log_level == DLT_LOG_DEFAULT) ||
(context->trace_status == DLT_TRACE_STATUS_DEFAULT))
{
- if (context->user_handle!=0)
+ if (context->user_handle >= DLT_FD_MINIMUM)
{
if (dlt_daemon_user_send_log_level(daemon, context, verbose)==-1)
{
if (app)
{
- if (app->user_handle!=0)
+ if (app->user_handle >= DLT_FD_MINIMUM)
{
if (dlt_daemon_user_send_log_state(daemon, app, verbose)==-1)
{