summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorT. Lohmar <smarttv640@gmail.com>2014-08-24 21:33:30 +0200
committerT. Lohmar <smarttv640@gmail.com>2014-08-24 21:33:30 +0200
commit269b4cfbc2f02fe5562bc8c6336638fbcec1db4b (patch)
tree0636f96729100aaf2bdfa2f1fcd55e4c03bea44b
parent50294bd5574b00f840bd9d0deae5190d0de56073 (diff)
downloadvdr-plugin-smarttvweb-269b4cfbc2f02fe5562bc8c6336638fbcec1db4b.tar.gz
vdr-plugin-smarttvweb-269b4cfbc2f02fe5562bc8c6336638fbcec1db4b.tar.bz2
Read Errno in case of failures.
-rwxr-xr-xresponsefile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/responsefile.c b/responsefile.c
index d505e4c..f5bb319 100755
--- a/responsefile.c
+++ b/responsefile.c
@@ -26,6 +26,8 @@
#include <vector>
#include <sys/stat.h>
+#include <errno.h>
+#include <cstring>
//#define MAXLEN 4096
#define DEBUGPREFIX mLog->getTimeString() << ": mReqId= " << mRequest->mReqId << " fd= " << mRequest->mFd
@@ -39,8 +41,6 @@ cResponseFile::cResponseFile(cHttpResource* req) : cResponseBase(req), mFile(NUL
cResponseFile::~cResponseFile() {
if (mFile != NULL) {
- *(mLog->log())<< DEBUGPREFIX
- << " ERROR: mFile still open. Closing now..." << endl;
fclose(mFile);
mFile = NULL;
}
@@ -113,9 +113,9 @@ int cResponseFile::openFile(const char *name) {
mFile = fopen(name, "r");
if (!mFile) {
*(mLog->log())<< DEBUGPREFIX
- << " fopen failed pathbuf= " << name
- << endl;
- // sendError(403, "Forbidden", NULL, "Access denied.");
+ << " fopen failed pathbuf= " << name
+ << " errno= " << errno
+ << " " << strerror(errno) << endl;
return ERROR;
}
return OKAY;