diff options
| author | guozhanxin <[email protected]> | 2021-03-31 13:59:58 +0800 |
|---|---|---|
| committer | guozhanxin <[email protected]> | 2021-03-31 14:00:09 +0800 |
| commit | d49cc6452406d70ce7a2e2acce786fbe697673b9 (patch) | |
| tree | ddb998772a7915a57ab93b8b52953c99259c3696 /components/drivers/src | |
| parent | f9be3c80e3631ebfc1ecc3e1f1d2df21277c0608 (diff) | |
| parent | 61be3180f57bcb58a7a62acb67e3179934d500b8 (diff) | |
Merge remote-tracking branch 'remotes/origin/master' into add_error_check
Diffstat (limited to 'components/drivers/src')
| -rw-r--r-- | components/drivers/src/pipe.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c index 10b880ff7a..236c1ffec7 100644 --- a/components/drivers/src/pipe.c +++ b/components/drivers/src/pipe.c @@ -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++); |
