summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Muck <christian.muck@bmw.de>2012-01-13 09:47:08 +0100
committerChristian Muck <christian.muck@bmw.de>2012-01-13 09:47:08 +0100
commitb512a5a86504ce52371f0ff01bd13fb903d156ad (patch)
tree9f113ba43cef2294ee44901631a1d1ba844ed070 /src
parent0b78edd4b27365f508d79c8dcbe431e6c0f947cc (diff)
parent03367d2faff8d7d9d12cfb03b272ac4a8a9f1ca3 (diff)
downloadDLT-daemon-b512a5a86504ce52371f0ff01bd13fb903d156ad.tar.gz
Merge branch 'tmp'
Diffstat (limited to 'src')
-rw-r--r--src/lib/dlt_filetransfer.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/lib/dlt_filetransfer.c b/src/lib/dlt_filetransfer.c
index 7377cb6..c11db67 100644
--- a/src/lib/dlt_filetransfer.c
+++ b/src/lib/dlt_filetransfer.c
@@ -54,31 +54,20 @@ time_t getFileCreationDate(const char* file){
stat(file, &st);
return st.st_ctime;
}
+
+//!Returns the creation date of a file
+/** Format of the creation date is Day Mon dd hh:mm:ss yyyy
+ * @param file Absolute file path
+ * @return Returns the creation date of a file
+*/
char* getFileCreationDate2(const char* file){
struct stat st;
stat(file, &st);
struct tm *ts= localtime(&st.st_ctime);
- //char buf[80];
- /* Format and print the time, "ddd yyyy-mm-dd hh:mm:ss zzz" */
- //strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", ts);
return asctime(ts);
}
-
-
-
-//void sighandler(int sig)
-//{
-//
-// fprintf(stderr, "Signal handler called with %d\n", sig);
-// signal(sig, &sighandler);
-// exit(1);
-//
-//}
-
-
-
//!Checks if the file exists
/**@param file Absolute file path
* @return Returns 1 if the file exists, 0 if the file does not exist
@@ -126,7 +115,7 @@ int doRemoveFile(const char*filename){
void dlt_user_log_file_errorMessage(DltContext *fileContext, const char *filename, int errorCode){
- if(-errno != -2)
+ if(errno != ENOENT)
{
DLT_LOG(*fileContext,DLT_LOG_ERROR,
DLT_STRING("FLER"),
@@ -174,7 +163,6 @@ int dlt_user_log_file_infoAbout(DltContext *fileContext, const char *filename){
);
return 0;
} else {
-
dlt_user_log_file_errorMessage(fileContext,filename,ERROR_INFO_ABOUT);
return ERROR_INFO_ABOUT;
}
@@ -194,19 +182,12 @@ int dlt_user_log_file_infoAbout(DltContext *fileContext, const char *filename){
*/
int dlt_user_log_file_complete(DltContext *fileContext, const char *filename, int deleteFlag, int timeout)
{
- //No signal handling in library - part of the main program!
- //signal(SIGABRT, &sighandler);
- //signal(SIGTERM, &sighandler);
- //signal(SIGINT, &sighandler);
-
if(!isFile(filename))
{
dlt_user_log_file_errorMessage(fileContext,filename, ERROR_FILE_COMPLETE);
return ERROR_FILE_COMPLETE;
}
- //dlt_user_log_file_infoAbout(fileContext,filename);
-
if(dlt_user_log_file_header(fileContext,filename) != 0)
{
return ERROR_FILE_COMPLETE1;