mirror of
https://github.com/znc/znc.git
synced 2026-05-02 03:22:33 +02:00
Don't create empty .registry files for module data
This command showed a *lot* of empty files in ZNC's data dir find ~/.znc -iname ".registry" -size 0|wc -l Thanks to SilverLeo git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1010 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -944,6 +944,9 @@ bool CString::RightChomp(unsigned int uLen) {
|
||||
|
||||
//////////////// MCString ////////////////
|
||||
int MCString::WriteToDisk(const CString& sPath, mode_t iMode) {
|
||||
if (this->empty())
|
||||
return MCS_SUCCESS;
|
||||
|
||||
CFile cFile(sPath);
|
||||
if (!cFile.Open(O_WRONLY|O_CREAT|O_TRUNC, iMode)) {
|
||||
return MCS_EOPEN;
|
||||
@@ -973,7 +976,7 @@ int MCString::WriteToDisk(const CString& sPath, mode_t iMode) {
|
||||
int MCString::ReadFromDisk(const CString& sPath, mode_t iMode) {
|
||||
clear();
|
||||
CFile cFile(sPath);
|
||||
if (!cFile.Open(O_RDONLY|O_CREAT, iMode)) {
|
||||
if (!cFile.Open(O_RDONLY, iMode)) {
|
||||
return MCS_EOPEN;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user