From 7e0014865e422ae8a3f78731e988e87a4723afa6 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 12 Feb 2010 16:39:09 +0000 Subject: [PATCH] added: loggin to upload.cpp git-svn-id: svn://ttmath.org/publicrep/winix/trunk@571 e52654a7-88a9-db11-a3e9-0013d4bc506e --- content/upload.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/content/upload.cpp b/content/upload.cpp index 138b145..a0ccf0f 100755 --- a/content/upload.cpp +++ b/content/upload.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include "content.h" #include "../core/request.h" #include "../core/data.h" @@ -64,9 +66,20 @@ struct stat sb; } else { + int err = errno; + // !! skasowac takze plik z bazy danych - log << log1 << "Content: can't move the tmp file from: " << tmp_filename; - log << log1 << ", to: " << path << logend; + log << log1 << "Content: can't move the tmp file from: " << tmp_filename; + log << log1 << ", to: " << path; + log << log1 << ", errno: " << err; + + const char * err_msg = strerror(err); + + if( err_msg ) + log << log1 << ": " << err_msg; + + log << logend; + request.status = Error::permission_denied; } }