mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 11:30:01 +08:00
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into develop_one
This commit is contained in:
@@ -647,7 +647,7 @@ int dfs_elm_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count)
|
||||
|
||||
d->d_namlen = (rt_uint8_t)rt_strlen(fn);
|
||||
d->d_reclen = (rt_uint16_t)sizeof(struct dirent);
|
||||
rt_strncpy(d->d_name, fn, rt_strlen(fn) + 1);
|
||||
rt_strncpy(d->d_name, fn, DFS_PATH_MAX);
|
||||
|
||||
index ++;
|
||||
if (index * sizeof(struct dirent) >= count)
|
||||
|
||||
@@ -1119,7 +1119,7 @@ int nfs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count)
|
||||
|
||||
d->d_namlen = rt_strlen(name);
|
||||
d->d_reclen = (rt_uint16_t)sizeof(struct dirent);
|
||||
rt_strncpy(d->d_name, name, rt_strlen(name) + 1);
|
||||
rt_strncpy(d->d_name, name, DFS_PATH_MAX);
|
||||
|
||||
index ++;
|
||||
if (index * sizeof(struct dirent) >= count)
|
||||
|
||||
@@ -276,7 +276,7 @@ int dfs_romfs_getdents(struct dfs_fd *file, struct dirent *dirp, uint32_t count)
|
||||
|
||||
d->d_namlen = rt_strlen(name);
|
||||
d->d_reclen = (rt_uint16_t)sizeof(struct dirent);
|
||||
rt_strncpy(d->d_name, name, rt_strlen(name) + 1);
|
||||
rt_strncpy(d->d_name, name, DFS_PATH_MAX);
|
||||
|
||||
/* move to next position */
|
||||
++ file->pos;
|
||||
|
||||
@@ -320,7 +320,7 @@ static const struct dfs_file_ops pipe_fops =
|
||||
};
|
||||
#endif /* end of RT_USING_POSIX */
|
||||
|
||||
rt_err_t rt_pipe_open (rt_device_t device, rt_uint16_t oflag)
|
||||
rt_err_t rt_pipe_open(rt_device_t device, rt_uint16_t oflag)
|
||||
{
|
||||
rt_pipe_t *pipe = (rt_pipe_t *)device;
|
||||
rt_err_t ret = RT_EOK;
|
||||
@@ -348,7 +348,7 @@ __exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
rt_err_t rt_pipe_close (rt_device_t device)
|
||||
rt_err_t rt_pipe_close(rt_device_t device)
|
||||
{
|
||||
rt_pipe_t *pipe = (rt_pipe_t *)device;
|
||||
|
||||
@@ -366,7 +366,7 @@ rt_err_t rt_pipe_close (rt_device_t device)
|
||||
return RT_EOK;
|
||||
}
|
||||
|
||||
rt_size_t rt_pipe_read (rt_device_t device, rt_off_t pos, void *buffer, rt_size_t count)
|
||||
rt_size_t rt_pipe_read(rt_device_t device, rt_off_t pos, void *buffer, rt_size_t count)
|
||||
{
|
||||
uint8_t *pbuf;
|
||||
rt_size_t read_bytes = 0;
|
||||
@@ -394,7 +394,7 @@ rt_size_t rt_pipe_read (rt_device_t device, rt_off_t pos, void *buffer, rt_siz
|
||||
return read_bytes;
|
||||
}
|
||||
|
||||
rt_size_t rt_pipe_write (rt_device_t device, rt_off_t pos, const void *buffer, rt_size_t count)
|
||||
rt_size_t rt_pipe_write(rt_device_t device, rt_off_t pos, const void *buffer, rt_size_t count)
|
||||
{
|
||||
uint8_t *pbuf;
|
||||
rt_size_t write_bytes = 0;
|
||||
@@ -531,8 +531,8 @@ int rt_pipe_delete(const char *name)
|
||||
int pipe(int fildes[2])
|
||||
{
|
||||
rt_pipe_t *pipe;
|
||||
char dname[8];
|
||||
char dev_name[32];
|
||||
char dname[RT_NAME_MAX];
|
||||
char dev_name[RT_NAME_MAX * 4];
|
||||
static int pipeno = 0;
|
||||
|
||||
rt_snprintf(dname, sizeof(dname), "pipe%d", pipeno++);
|
||||
|
||||
@@ -831,7 +831,7 @@ int finsh_system_init(void)
|
||||
__section_end("FSymTab"));
|
||||
finsh_system_var_init(__section_begin("VSymTab"),
|
||||
__section_end("VSymTab"));
|
||||
#elif defined (__GNUC__) || defined(__TI_COMPILER_VERSION__)
|
||||
#elif defined (__GNUC__) || defined(__TI_COMPILER_VERSION__) || defined(__TASKING__)
|
||||
/* GNU GCC Compiler and TI CCS */
|
||||
extern const int __fsymtab_start;
|
||||
extern const int __fsymtab_end;
|
||||
|
||||
@@ -21,10 +21,15 @@
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
#include <rtdevice.h>
|
||||
#endif
|
||||
|
||||
#define DBG_TAG "TIME"
|
||||
#define DBG_LVL DBG_INFO
|
||||
#include <rtdbg.h>
|
||||
|
||||
/* seconds per day */
|
||||
#define SPD 24*60*60
|
||||
|
||||
@@ -219,6 +224,7 @@ RT_WEAK time_t time(time_t *t)
|
||||
|
||||
if(time_now == (time_t)-1)
|
||||
{
|
||||
LOG_W("Cannot find a RTC device to provide time!");
|
||||
errno = ENOSYS;
|
||||
}
|
||||
|
||||
@@ -246,12 +252,13 @@ int stime(const time_t *t)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_W("Cannot find a RTC device to provide time!");
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
#else
|
||||
LOG_W("Cannot find a RTC device to provide time!");
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
#endif /* RT_USING_RTC */
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : tftp_port.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* File : tftp_port.c
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
|
||||
Reference in New Issue
Block a user