improve temp file creation error message
This commit is contained in:
parent
607bd5e204
commit
33febc9649
@ -44,6 +44,7 @@
|
|||||||
#include "transcode.h"
|
#include "transcode.h"
|
||||||
#include "md5ut.h"
|
#include "md5ut.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "smallut.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -365,9 +366,13 @@ TempFile::Internal::Internal(const string& suffix)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_filename = filename + suffix;
|
m_filename = filename + suffix;
|
||||||
if (close(open(m_filename.c_str(), O_CREAT | O_EXCL, 0600)) != 0) {
|
int fd1 = open(m_filename.c_str(), O_CREAT | O_EXCL, 0600);
|
||||||
m_reason = string("Could not open/create") + m_filename;
|
if (fd1 < 0) {
|
||||||
|
m_reason = string("Open/create error. errno : ") +
|
||||||
|
lltodecstr(errno) + " file name: " + m_filename;
|
||||||
m_filename.erase();
|
m_filename.erase();
|
||||||
|
} else {
|
||||||
|
close(fd1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user