summaryrefslogtreecommitdiff
path: root/components/drivers/src
diff options
context:
space:
mode:
authorsszlbg <[email protected]>2021-07-25 17:00:00 +0800
committersszlbg <[email protected]>2021-07-25 17:00:00 +0800
commitbf88963a3ec85ce6da013e4cd1c59ec5041d29e1 (patch)
treed4cd7d4fa3ff6e7b0c859a7660209787f47d168b /components/drivers/src
parent88d4faf68735948d6310e2d2271d576c5de254a0 (diff)
parent2b201cbb00c512def085332d7fb09194656418b9 (diff)
Merge branch 'master' into at_client-rt_realloc_iss
# Conflicts: # components/net/at/src/at_client.c
Diffstat (limited to 'components/drivers/src')
-rw-r--r--components/drivers/src/pipe.c12
-rw-r--r--components/drivers/src/workqueue.c6
2 files changed, 10 insertions, 8 deletions
diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c
index 236c1ffec7..7fa5eb067d 100644
--- a/components/drivers/src/pipe.c
+++ b/components/drivers/src/pipe.c
@@ -11,11 +11,13 @@
#include <rthw.h>
#include <rtdevice.h>
#include <stdint.h>
+#include <sys/errno.h>
-#if defined(RT_USING_POSIX)
+#ifdef RT_USING_POSIX
#include <dfs_file.h>
#include <dfs_posix.h>
#include <dfs_poll.h>
+#include <sys/ioctl.h>
static int pipe_fops_open(struct dfs_fd *fd)
{
@@ -374,7 +376,7 @@ rt_size_t rt_pipe_read(rt_device_t device, rt_off_t pos, void *buffer, rt_size_t
if (device == RT_NULL)
{
- rt_set_errno(-EINVAL);
+ rt_set_errno(EINVAL);
return 0;
}
if (count == 0) return 0;
@@ -402,7 +404,7 @@ rt_size_t rt_pipe_write(rt_device_t device, rt_off_t pos, const void *buffer, rt
if (device == RT_NULL)
{
- rt_set_errno(-EINVAL);
+ rt_set_errno(EINVAL);
return 0;
}
if (count == 0) return 0;
@@ -516,12 +518,12 @@ int rt_pipe_delete(const char *name)
}
else
{
- result = -ENODEV;
+ result = -RT_EINVAL;
}
}
else
{
- result = -ENODEV;
+ result = -RT_EINVAL;
}
return result;
diff --git a/components/drivers/src/workqueue.c b/components/drivers/src/workqueue.c
index f195dad927..065c505015 100644
--- a/components/drivers/src/workqueue.c
+++ b/components/drivers/src/workqueue.c
@@ -358,7 +358,7 @@ rt_err_t rt_work_cancel(struct rt_work *work)
return rt_workqueue_cancel_work(sys_workq, work);
}
-int rt_work_sys_workqueue_init(void)
+static int rt_work_sys_workqueue_init(void)
{
if (sys_workq != RT_NULL)
return RT_EOK;
@@ -370,5 +370,5 @@ int rt_work_sys_workqueue_init(void)
return RT_EOK;
}
INIT_PREV_EXPORT(rt_work_sys_workqueue_init);
-#endif
-#endif
+#endif /* RT_USING_SYSTEM_WORKQUEUE */
+#endif /* RT_USING_HEAP */