implemented why2_open
wow no memory leak ngl didn't expect that
This commit is contained in:
parent
263c73b80f
commit
a42e0a9ca9
@ -77,7 +77,7 @@ why2_log_file why2_init_logger(char *directoryPath)
|
|||||||
|
|
||||||
sprintf(filePath, WHY2_LOG_FORMATTING, directoryPath, dateBuffer, buffer); //GENERATE LOG-NAME
|
sprintf(filePath, WHY2_LOG_FORMATTING, directoryPath, dateBuffer, buffer); //GENERATE LOG-NAME
|
||||||
|
|
||||||
file = open(filePath, O_RDWR | O_APPEND | O_CREAT, 0644); //CREATE LOG FILE
|
file = why2_open(filePath, O_RDWR | O_APPEND | O_CREAT, 0644); //CREATE LOG FILE
|
||||||
|
|
||||||
//CREATE SYMLINK
|
//CREATE SYMLINK
|
||||||
sprintf(latestBuffer, WHY2_LOG_LATEST_FORMATTING, WHY2_WRITE_DIR, WHY2_LOG_LATEST); //GENERATE LATEST.log PATH
|
sprintf(latestBuffer, WHY2_LOG_LATEST_FORMATTING, WHY2_WRITE_DIR, WHY2_LOG_LATEST); //GENERATE LATEST.log PATH
|
||||||
|
@ -31,7 +31,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
void why2_deallocate_logger(why2_log_file logger)
|
void why2_deallocate_logger(why2_log_file logger)
|
||||||
{
|
{
|
||||||
close(logger.file);
|
why2_deallocate(&logger.file);
|
||||||
why2_deallocate(logger.filename);
|
why2_deallocate(logger.filename);
|
||||||
|
|
||||||
logger.filename = NULL;
|
logger.filename = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user