mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
Cancellation points: Close up some logic to eliminte some race conditions.
This commit is contained in:
+1
-1
@@ -88,7 +88,7 @@ int close(int fd)
|
||||
|
||||
/* close() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
/* Did we get a valid file descriptor? */
|
||||
|
||||
+1
-1
@@ -223,7 +223,7 @@ int fcntl(int fd, int cmd, ...)
|
||||
|
||||
/* fcntl() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* Setup to access the variable argument list */
|
||||
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ int fsync(int fd)
|
||||
|
||||
/* fsync() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* Get the file structure corresponding to the file descriptor. */
|
||||
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ int open(const char *path, int oflags, ...)
|
||||
|
||||
/* open() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* If the file is opened for creation, then get the mode bits */
|
||||
|
||||
|
||||
+1
-1
@@ -368,7 +368,7 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
|
||||
|
||||
/* poll() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* This semaphore is used for signaling and, hence, should not have
|
||||
* priority inheritance enabled.
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ ssize_t pread(int fd, FAR void *buf, size_t nbytes, off_t offset)
|
||||
|
||||
/* pread() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* Get the file structure corresponding to the file descriptor. */
|
||||
|
||||
|
||||
+2
-2
@@ -143,7 +143,7 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset)
|
||||
|
||||
/* pread() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* Get the file structure corresponding to the file descriptor. */
|
||||
|
||||
@@ -161,6 +161,6 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset)
|
||||
ret = file_pwrite(filep, buf, nbytes, offset);
|
||||
}
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
return ret;
|
||||
}
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ ssize_t read(int fd, FAR void *buf, size_t nbytes)
|
||||
|
||||
/* read() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* Did we get a valid file descriptor? */
|
||||
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds,
|
||||
|
||||
/* select() is cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* How many pollfd structures do we need to allocate? */
|
||||
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ ssize_t write(int fd, FAR const void *buf, size_t nbytes)
|
||||
|
||||
/* write() is a cancellation point */
|
||||
|
||||
enter_cancellation_point();
|
||||
(void)enter_cancellation_point();
|
||||
|
||||
/* Did we get a valid file descriptor? */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user