mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-12-09 17:42:55 +00:00
Show errno when fail to open file pointer
This commit is contained in:
parent
91ad974684
commit
2e1818394e
1 changed files with 4 additions and 2 deletions
|
|
@ -1,4 +1,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
#include "../network.h"
|
#include "../network.h"
|
||||||
#include "pc/djui/djui.h"
|
#include "pc/djui/djui.h"
|
||||||
#include "pc/mods/mods.h"
|
#include "pc/mods/mods.h"
|
||||||
|
|
@ -287,7 +289,7 @@ after_filled:;
|
||||||
packet_write(&p, &chunk, sizeof(u8) * chunkFill);
|
packet_write(&p, &chunk, sizeof(u8) * chunkFill);
|
||||||
network_send_to(0, &p);
|
network_send_to(0, &p);
|
||||||
|
|
||||||
LOG_INFO("Sent chunk: offset %llu, length %llu", requestOffset, chunkFill);
|
//LOG_INFO("Sent chunk: offset %llu, length %llu", requestOffset, chunkFill);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void open_mod_file(struct Mod* mod, struct ModFile* file) {
|
static void open_mod_file(struct Mod* mod, struct ModFile* file) {
|
||||||
|
|
@ -305,7 +307,7 @@ static void open_mod_file(struct Mod* mod, struct ModFile* file) {
|
||||||
|
|
||||||
file->fp = fopen(fullPath, "wb");
|
file->fp = fopen(fullPath, "wb");
|
||||||
if (file->fp == NULL) {
|
if (file->fp == NULL) {
|
||||||
LOG_ERROR("unable to open for write: '%s'", fullPath);
|
LOG_ERROR("unable to open for write: '%s' - '%s'", fullPath, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOG_INFO("Opened mod file pointer: %s", fullPath);
|
LOG_INFO("Opened mod file pointer: %s", fullPath);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue