Skip to content

Commit 9dc1855

Browse files
committed
fix MDTM, fix localtime spelling, fix wii asset copying, fix wii building against libogc2
1 parent e8ef5f9 commit 9dc1855

File tree

7 files changed

+28
-29
lines changed

7 files changed

+28
-29
lines changed

Diff for: CMakeLists.txt

+6-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13)
22

33
set(FTPSRV_VERSION_MAJOR 1)
44
set(FTPSRV_VERSION_MINOR 2)
5-
set(FTPSRV_VERSION_PATCH 1)
5+
set(FTPSRV_VERSION_PATCH 2)
66
set(FTPSRV_VERSION ${FTPSRV_VERSION_MAJOR}.${FTPSRV_VERSION_MINOR}.${FTPSRV_VERSION_PATCH})
77

88
project(ftpsrv
@@ -120,7 +120,7 @@ endif()
120120
function(fetch_minini)
121121
FetchContent_Declare(minIni
122122
GIT_REPOSITORY https://github.com/ITotalJustice/minIni-nx.git
123-
GIT_TAG 63ec295
123+
GIT_TAG 11cac8b
124124
)
125125

126126
set(MININI_USE_NX ${NINTENDO_SWITCH})
@@ -449,7 +449,8 @@ else()
449449
SMDH ${PROJECT_NAME}.smdh
450450
)
451451
elseif(NINTENDO_WII)
452-
ftp_set_options(ftpsrv 769 10 1024*64)
452+
# NOTE: 64k net_send/net_recv breaks with ogc2...
453+
ftp_set_options(ftpsrv 769 10 1024*32)
453454
fetch_minini()
454455

455456
target_compile_definitions(ftpsrv PUBLIC
@@ -466,6 +467,8 @@ else()
466467
ftp_add(ftpexe)
467468

468469
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/apps/ftpsrv)
470+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/wii/meta.xml ${CMAKE_CURRENT_BINARY_DIR}/apps/ftpsrv/meta.xml)
471+
469472
ogc_create_dol(ftpexe)
470473

471474
add_custom_command(
@@ -474,10 +477,6 @@ else()
474477
${CMAKE_CURRENT_SOURCE_DIR}/src/platform/wii/icon.png
475478
${CMAKE_CURRENT_BINARY_DIR}/apps/ftpsrv/icon.png
476479

477-
COMMAND ${CMAKE_COMMAND} -E copy
478-
${CMAKE_CURRENT_SOURCE_DIR}/src/platform/wii/meta.xml
479-
${CMAKE_CURRENT_BINARY_DIR}/apps/ftpsrv/meta.xml
480-
481480
COMMAND ${CMAKE_COMMAND} -E copy
482481
${CMAKE_CURRENT_BINARY_DIR}/ftpexe.dol
483482
${CMAKE_CURRENT_BINARY_DIR}/apps/ftpsrv/boot.dol

Diff for: src/ftpsrv.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ static void ftp_cmd_MDTM(struct FtpSession* session, const char* data) {
12941294
if (!unpack_time(&st.st_mtime, &tm)) {
12951295
ftp_client_msg(session, 550, "Syntax error in parameters or arguments, %s. Failed to get timestamp: %s", strerror(errno), fullpath.s);
12961296
} else {
1297-
ftp_client_msg(session, 213, "%04d%02d%02d%02d%02d", tm.tm_year + 1900, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
1297+
ftp_client_msg(session, 213, "%04d%02d%02d%02d%02d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
12981298
}
12991299
}
13001300
}

Diff for: src/platform/3ds/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ int main(void) {
174174
iprintf(TEXT_YELLOW "pass: %s" TEXT_NORMAL "\n", g_ftpsrv_config.pass);
175175
}
176176
iprintf(TEXT_YELLOW "timeout: %us" TEXT_NORMAL "\n", g_ftpsrv_config.timeout);
177-
iprintf(TEXT_YELLOW "use_locatime: %us" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
177+
iprintf(TEXT_YELLOW "use_localtime: %u" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
178178
iprintf(TEXT_YELLOW "log: %d" TEXT_NORMAL "\n", log_enabled);
179179
iprintf(TEXT_YELLOW "\nconfig: %s" TEXT_NORMAL "\n", INI_PATH);
180180
iprintf("\n");

Diff for: src/platform/nds/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ int main(void) {
155155
iprintf(TEXT_YELLOW "pass: %s" TEXT_NORMAL "\n", g_ftpsrv_config.pass);
156156
}
157157
iprintf(TEXT_YELLOW "timeout: %us" TEXT_NORMAL "\n", g_ftpsrv_config.timeout);
158-
iprintf(TEXT_YELLOW "use_locatime: %us" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
158+
iprintf(TEXT_YELLOW "use_localtime: %u" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
159159
iprintf(TEXT_YELLOW "log: %d" TEXT_NORMAL "\n", log_enabled);
160160
iprintf(TEXT_YELLOW "\nconfig: %s" TEXT_NORMAL "\n", INI_PATH);
161161
iprintf("\n");

Diff for: src/platform/nx/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ int main(int argc, char** argv) {
199199
}
200200
printf("\n");
201201
printf(TEXT_YELLOW "timeout: %us" TEXT_NORMAL "\n", g_ftpsrv_config.timeout);
202-
printf(TEXT_YELLOW "use_locatime: %us" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
202+
printf(TEXT_YELLOW "use_localtime: %u" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
203203
printf(TEXT_YELLOW "log: %d" TEXT_NORMAL "\n", log_enabled);
204204
printf(TEXT_YELLOW "mount_devices: %d" TEXT_NORMAL "\n", mount_devices);
205205
printf(TEXT_YELLOW "save_writable: %d" TEXT_NORMAL "\n", save_writable);

Diff for: src/platform/unistd/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int main(int argc, char** argv) {
147147
printf(TEXT_YELLOW "pass: %s" TEXT_NORMAL "\n", ftpsrv_config.pass);
148148
}
149149
printf(TEXT_YELLOW "timeout: %us" TEXT_NORMAL "\n", ftpsrv_config.timeout);
150-
printf(TEXT_YELLOW "use_locatime: %us" TEXT_NORMAL "\n", ftpsrv_config.use_localtime);
150+
printf(TEXT_YELLOW "use_localtime: %u" TEXT_NORMAL "\n", ftpsrv_config.use_localtime);
151151

152152
int timeout = -1;
153153
if (ftpsrv_config.timeout) {

Diff for: src/platform/wii/main.c

+17-17
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ static void processEvents(void) {
5757

5858
switch (g_callback_data[i].type) {
5959
case FTP_API_LOG_TYPE_COMMAND:
60-
iprintf(TEXT_BLUE "Command: %s" TEXT_NORMAL "\n", g_callback_data[i].msg);
60+
printf(TEXT_BLUE "Command: %s" TEXT_NORMAL "\n", g_callback_data[i].msg);
6161
break;
6262
case FTP_API_LOG_TYPE_RESPONSE:
63-
iprintf(TEXT_GREEN "Response: %s" TEXT_NORMAL "\n", g_callback_data[i].msg);
63+
printf(TEXT_GREEN "Response: %s" TEXT_NORMAL "\n", g_callback_data[i].msg);
6464
break;
6565
case FTP_API_LOG_TYPE_ERROR:
66-
iprintf(TEXT_RED "Error: %s" TEXT_NORMAL "\n", g_callback_data[i].msg);
66+
printf(TEXT_RED "Error: %s" TEXT_NORMAL "\n", g_callback_data[i].msg);
6767
break;
6868
}
6969
}
@@ -106,9 +106,9 @@ static void consolePrint(const char* fmt, ...) {
106106

107107
static int error_loop(const char* msg) {
108108
log_file_write(msg);
109-
iprintf("Error: %s\n\n", msg);
110-
iprintf("Modify the config at: %s\n\n", INI_PATH);
111-
iprintf("\tPress (+) to exit...\n");
109+
printf("Error: %s\n\n", msg);
110+
printf("Modify the config at: %s\n\n", INI_PATH);
111+
printf("\tPress (+) to exit...\n");
112112

113113
while (1) {
114114
WPAD_ScanPads();
@@ -142,7 +142,7 @@ int main(void) {
142142
// Allocate memory for the display in the uncached region
143143
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
144144

145-
// Initialise the console, required for iprintf
145+
// Initialise the console, required for printf
146146
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
147147

148148
// Set up the video registers with the chosen mode
@@ -207,19 +207,19 @@ int main(void) {
207207
while (1) {
208208
if (!has_net && net_get_status() >= 0) {
209209
const struct in_addr addr = {net_gethostip()};
210-
iprintf(TEXT_YELLOW "ip: %s\n", inet_ntoa(addr));
211-
iprintf(TEXT_YELLOW "port: %d" TEXT_NORMAL "\n", g_ftpsrv_config.port);
210+
printf(TEXT_YELLOW "ip: %s\n", inet_ntoa(addr));
211+
printf(TEXT_YELLOW "port: %d" TEXT_NORMAL "\n", g_ftpsrv_config.port);
212212
if (g_ftpsrv_config.anon) {
213-
iprintf(TEXT_YELLOW "anon: %d" TEXT_NORMAL "\n", 1);
213+
printf(TEXT_YELLOW "anon: %d" TEXT_NORMAL "\n", 1);
214214
} else {
215-
iprintf(TEXT_YELLOW "user: %s" TEXT_NORMAL "\n", g_ftpsrv_config.user);
216-
iprintf(TEXT_YELLOW "pass: %s" TEXT_NORMAL "\n", g_ftpsrv_config.pass);
215+
printf(TEXT_YELLOW "user: %s" TEXT_NORMAL "\n", g_ftpsrv_config.user);
216+
printf(TEXT_YELLOW "pass: %s" TEXT_NORMAL "\n", g_ftpsrv_config.pass);
217217
}
218-
iprintf(TEXT_YELLOW "log: %d" TEXT_NORMAL "\n", log_enabled);
219-
iprintf(TEXT_YELLOW "timeout: %us" TEXT_NORMAL "\n", g_ftpsrv_config.timeout);
220-
iprintf(TEXT_YELLOW "use_locatime: %us" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
221-
iprintf(TEXT_YELLOW "\nconfig: %s" TEXT_NORMAL "\n", INI_PATH);
222-
iprintf("\n");
218+
printf(TEXT_YELLOW "log: %d" TEXT_NORMAL "\n", log_enabled);
219+
printf(TEXT_YELLOW "timeout: %us" TEXT_NORMAL "\n", g_ftpsrv_config.timeout);
220+
printf(TEXT_YELLOW "use_localtime: %u" TEXT_NORMAL "\n", g_ftpsrv_config.use_localtime);
221+
printf(TEXT_YELLOW "\nconfig: %s" TEXT_NORMAL "\n", INI_PATH);
222+
printf("\n");
223223
has_net = true;
224224
}
225225

0 commit comments

Comments
 (0)