From b76b2015be53c8abe86b5ce51380224718959d90 Mon Sep 17 00:00:00 2001 From: Christian Muck Date: Fri, 13 Jan 2012 12:18:26 +0100 Subject: [GSW-135] Fixed compile warnings --- src/system/dlt-system.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/system/dlt-system.c') diff --git a/src/system/dlt-system.c b/src/system/dlt-system.c index c2df24c..2902363 100755 --- a/src/system/dlt-system.c +++ b/src/system/dlt-system.c @@ -378,7 +378,8 @@ int dlt_system_parse_configuration(DltSystemOptions *options) void dlt_system_daemonize() { - int i,lfp,bytes_written,ret; + int i,ret; + //int lfp,bytes_written; /* Daemonize */ i=fork(); @@ -499,6 +500,7 @@ void dlt_system_signal_handler(int sig) int dlt_user_injection_callback(uint32_t service_id, void *data, uint32_t length) { char text[1024]; + int syserr = 0; strncpy(text,data,length); @@ -508,7 +510,10 @@ int dlt_user_injection_callback(uint32_t service_id, void *data, uint32_t length /* Execute shell command */ //DLT_LOG(shellContext, DLT_LOG_INFO, DLT_STRING("Execute command:"), DLT_STRING(text)); printf("Execute command: %s\n",text); - system(text); + if((syserr = system(text)) != 0) + { + printf("Abnormal exit status from %s: %d\n",text,syserr); + } break; default: //DLT_LOG(shellContext, DLT_LOG_WARN, DLT_STRING("Unknown command received! Service ID:"), DLT_UINT32(service_id),DLT_STRING("Command:"),DLT_STRING(text)); @@ -526,7 +531,7 @@ int dlt_user_injection_callback(uint32_t service_id, void *data, uint32_t length int main(int argc, char* argv[]) { - int sock; + int sock = -1; int bytes_read; socklen_t addr_len; char recv_data[MAXSTRLEN]; @@ -593,7 +598,7 @@ int main(int argc, char* argv[]) perror("Socket"); exit(1); } - server_addr.sin_family = AF_INET; + server_addr.sin_family = AF_INET; server_addr.sin_port = htons(options.SyslogPort); server_addr.sin_addr.s_addr = INADDR_ANY; bzero(&(server_addr.sin_zero), 8); -- cgit v1.2.1