mirror of https://github.com/wolfSSL/wolfssh.git
Fix FATFS compiling
FATFS compiling is currently broken due to several reasons. This fixes: * Bad parameter count for `WRENAME` * Missing `WFFLUSH` define * `WOLFSSH_STOREHANDLE` required for `WOLFSSH_FATFS` to work * Conflict when `NO_FILESYSTEM` is defined for wolfSSL and `WOLFSSH_FATFS` is defined by wolfSSH * Function called that can't be used with `WOLFSSH_FATFS` * Functions defined but not used with `WOLFSSH_FATFS` * Function parameters defined but not usedpull/786/head
parent
76e8b9f4ea
commit
0fd8b2033b
|
@ -1479,7 +1479,8 @@ int wolfSSH_SFTP_read(WOLFSSH* ssh)
|
|||
wolfSSH_SFTP_buffer_data(&state->buffer),
|
||||
wolfSSH_SFTP_buffer_size(&state->buffer));
|
||||
break;
|
||||
#if !defined(_WIN32_WCE) && !defined(WOLFSSH_ZEPHYR)
|
||||
#if !defined(_WIN32_WCE) && !defined(WOLFSSH_ZEPHYR) && \
|
||||
!defined(WOLFSSH_FATFS)
|
||||
case WOLFSSH_FTP_SETSTAT:
|
||||
ret = wolfSSH_SFTP_RecvSetSTAT(ssh, state->reqId,
|
||||
wolfSSH_SFTP_buffer_data(&state->buffer),
|
||||
|
@ -4685,6 +4686,9 @@ int SFTP_GetAttributes_Handle(WOLFSSH* ssh, byte* handle, int handleSz,
|
|||
static int SFTP_GetAttributes(void* fs, const char* fileName,
|
||||
WS_SFTP_FILEATRB* atr, byte noFollow, void* heap)
|
||||
{
|
||||
(void) fs;
|
||||
(void) noFollow;
|
||||
(void) heap;
|
||||
FILINFO info;
|
||||
FRESULT ret;
|
||||
int sz = (int)WSTRLEN(fileName);
|
||||
|
@ -5191,7 +5195,7 @@ int wolfSSH_SFTP_RecvLSTAT(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz)
|
|||
}
|
||||
|
||||
#if !defined(USE_WINDOWS_API) && !defined(WOLFSSH_ZEPHYR) \
|
||||
&& !defined(WOLFSSH_SFTP_SETMODE)
|
||||
&& !defined(WOLFSSH_SFTP_SETMODE) && !defined(WOLFSSH_FATFS)
|
||||
/* Set the files mode
|
||||
* return WS_SUCCESS on success */
|
||||
static int SFTP_SetMode(void* fs, char* name, word32 mode) {
|
||||
|
@ -5204,7 +5208,7 @@ static int SFTP_SetMode(void* fs, char* name, word32 mode) {
|
|||
#endif
|
||||
|
||||
#if !defined(USE_WINDOWS_API) && !defined(WOLFSSH_ZEPHYR) \
|
||||
&& !defined(WOLFSSH_SFTP_SETMODEHANDLE)
|
||||
&& !defined(WOLFSSH_SFTP_SETMODEHANDLE) && !defined(WOLFSSH_FATFS)
|
||||
/* Set the files mode
|
||||
* return WS_SUCCESS on success */
|
||||
static int SFTP_SetModeHandle(void* fs, WFD handle, word32 mode) {
|
||||
|
@ -5216,7 +5220,7 @@ static int SFTP_SetModeHandle(void* fs, WFD handle, word32 mode) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32_WCE) && !defined(WOLFSSH_ZEPHYR)
|
||||
#if !defined(_WIN32_WCE) && !defined(WOLFSSH_ZEPHYR) && !defined(WOLFSSH_FATFS)
|
||||
|
||||
/* sets a files attributes
|
||||
* returns WS_SUCCESS on success */
|
||||
|
|
|
@ -101,7 +101,7 @@ extern "C" {
|
|||
#endif
|
||||
#endif /* !WOLFSSH_HANDLE */
|
||||
|
||||
#ifdef NO_FILESYSTEM
|
||||
#if defined(NO_FILESYSTEM) && !defined(WOLFSSH_FATFS)
|
||||
#define WS_DELIM '/'
|
||||
#elif defined(WOLFSSL_NUCLEUS)
|
||||
#include "storage/nu_storage.h"
|
||||
|
@ -255,6 +255,7 @@ extern "C" {
|
|||
#define WSEEK_SET 0
|
||||
#define WSEEK_CUR 1
|
||||
#define WSEEK_END 2
|
||||
#define WFFLUSH(s) ((void)(s))
|
||||
static inline int ff_fopen(WFILE** f, const char* filename,
|
||||
const char* mode)
|
||||
{
|
||||
|
@ -585,7 +586,8 @@ extern "C" {
|
|||
|
||||
#if (defined(WOLFSSH_SFTP) || \
|
||||
defined(WOLFSSH_SCP) || defined(WOLFSSH_SSHD)) && \
|
||||
!defined(NO_WOLFSSH_SERVER) && !defined(NO_FILESYSTEM)
|
||||
!defined(NO_WOLFSSH_SERVER) && \
|
||||
(!defined(NO_FILESYSTEM) || defined(WOLFSSH_FATFS))
|
||||
|
||||
#ifndef SIZEOF_OFF_T
|
||||
/* if not using autoconf then make a guess on off_t size based on sizeof
|
||||
|
@ -1192,7 +1194,7 @@ extern "C" {
|
|||
#define WSTAT(fs,p,b) f_stat(p,b)
|
||||
#define WLSTAT(fs,p,b) f_stat(p,b)
|
||||
#define WREMOVE(fs,d) f_unlink((d))
|
||||
#define WRENAME(fs,fd,o,n) f_rename((o),(n))
|
||||
#define WRENAME(fs,o,n) f_rename((o),(n))
|
||||
#define WMKDIR(fs, p, m) f_mkdir(p)
|
||||
#define WFD int
|
||||
|
||||
|
|
|
@ -52,6 +52,10 @@ extern "C" {
|
|||
#define USE_WOLFSSH_MEMORY /* default memory handlers */
|
||||
#endif /* WMALLOC_USER */
|
||||
|
||||
/* SFTP requires storehandle when fatfs is in use */
|
||||
#ifdef WOLFSSH_FATFS
|
||||
#define WOLFSSH_STOREHANDLE
|
||||
#endif
|
||||
|
||||
#if defined (_WIN32)
|
||||
#define USE_WINDOWS_API
|
||||
|
|
Loading…
Reference in New Issue