Skip to content
Snippets Groups Projects
Commit b1938c06 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

sys/time.h: Fix timersub macro; time_t is unsigned

parent b73a7515
No related branches found
No related tags found
No related merge requests found
......@@ -11263,3 +11263,4 @@
struct sigevent. This initial implementation will only work in the
FLAT build. See the top-level TODO file for additional details
(2015-12-30).
......@@ -50,7 +50,7 @@
#include <stdbool.h> /* C99 boolean types */
#include <unistd.h> /* For getpid */
#include <semaphore.h> /* Needed for sem_t */
#include <signal.h> /* Needed for sigset_t */
#include <signal.h> /* Needed for sigset_t, includes this file */
#include <time.h> /* Needed for struct timespec */
/********************************************************************************
......@@ -441,8 +441,8 @@ int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
#include <sys/types.h>
#include <stdbool.h>
/* Avoid a circular dependencies by assuring that simple type definitions
* are avaiable in any inclusion ordering.
/* Avoid circular dependencies by assuring that simple type definitions are
* available in any inclusion ordering.
*/
#ifndef __PTHREAD_KEY_T_DEFINED
......
......@@ -45,8 +45,9 @@
#include <stdint.h>
#include <time.h>
#ifdef CONFIG_SIG_EVTHREAD
# include <pthread.h> /* Needed for pthread_attr_t */
# include <pthread.h> /* Needed for pthread_attr_t, includes this file */
#endif
/********************************************************************************
......@@ -320,8 +321,8 @@ int sigqueue(int pid, int signo, FAR void *sival_ptr);
#include <stdint.h>
/* Avoid a circular dependencies by assuring that simple type definitions
* are avaiable in any inclusion ordering.
/* Avoid circular dependencies by assuring that simple type definitions are
* available in any inclusion ordering.
*/
#ifndef __SIGSET_T_DEFINED
......
......@@ -78,12 +78,12 @@
do \
{ \
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
if ((vvp)->tv_usec < 0) \
if ((uvp)->tv_usec > (tvp)->tv_usec) \
{ \
(vvp)->tv_sec--; \
(vvp)->tv_usec += 1000000; \
(tvp)->tv_usec += 1000000; \
} \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
} \
while (0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment