mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-10-17 02:45:05 +00:00
New features: - SDK version 7.0.0 packages include version metadata and platform-specific application settings. - Apps gain POSIX support for file polling, terminal attributes, and standard input/output, plus additional C and POSIX functions. - Shell commands can launch installed headless apps using their registered app settings. - Apps can exit with a status code, and terminal clear commands support clearing from the cursor to the end, from the start through the cursor, or the entire display. Fixes: - SDK integration builds locate the build tool reliably and use settings for the selected platform. - ESP32 file operations handle invalid paths and existing directories more consistently.
27 lines
696 B
C++
27 lines
696 B
C++
// SPDX-License-Identifier: Apache-2.0
|
|
#include <sys/stat.h>
|
|
|
|
#include <cerrno>
|
|
|
|
// mkdir() on an existing FATFS mount root (e.g. "/sdcard") fails without setting EEXIST,
|
|
// which breaks the common "mkdir() then accept EEXIST" pattern. Any existing path reports EEXIST.
|
|
// A NULL path fails with EFAULT instead of crashing in the VFS (see vfs_null_path.cpp).
|
|
extern "C" {
|
|
|
|
int __real_mkdir(const char* path, mode_t mode);
|
|
|
|
int __wrap_mkdir(const char* path, mode_t mode) {
|
|
if (path == nullptr) {
|
|
errno = EFAULT;
|
|
return -1;
|
|
}
|
|
struct stat info;
|
|
if (stat(path, &info) == 0) {
|
|
errno = EEXIST;
|
|
return -1;
|
|
}
|
|
return __real_mkdir(path, mode);
|
|
}
|
|
|
|
}
|