diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-10-03 09:10:00 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-10-06 23:31:03 -0700 |
commit | 0faad0a0025cb4c6cbdba44e5b259690fae27b1a (patch) | |
tree | 4d4e3e6709e02d03244457107d0a59e6cb4d26ff /src/sysdep.c | |
parent | b5d08da1e9ea7ee1334d810348c656babe6a15d2 (diff) | |
download | emacs-0faad0a0025cb4c6cbdba44e5b259690fae27b1a.tar.gz |
Coalesce duplicate make_lisp_timeval etc.
* src/sysdep.c (timeval_to_timespec, make_lisp_timeval):
Coalesce duplicate definitions (Bug#32902).
Diffstat (limited to 'src/sysdep.c')
-rw-r--r-- | src/sysdep.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 06956863611..7a0c8a8ab85 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -3047,6 +3047,22 @@ list_system_processes (void) #endif /* !defined (WINDOWSNT) */ + +#if defined __FreeBSD__ || defined DARWIN_OS + +static struct timespec +timeval_to_timespec (struct timeval t) +{ + return make_timespec (t.tv_sec, t.tv_usec * 1000); +} +static Lisp_Object +make_lisp_timeval (struct timeval t) +{ + return make_lisp_time (timeval_to_timespec (t)); +} + +#endif + #if defined GNU_LINUX && defined HAVE_LONG_LONG_INT static struct timespec time_from_jiffies (unsigned long long tval, long hz) @@ -3567,18 +3583,6 @@ system_process_attributes (Lisp_Object pid) #elif defined __FreeBSD__ -static struct timespec -timeval_to_timespec (struct timeval t) -{ - return make_timespec (t.tv_sec, t.tv_usec * 1000); -} - -static Lisp_Object -make_lisp_timeval (struct timeval t) -{ - return make_lisp_time (timeval_to_timespec (t)); -} - Lisp_Object system_process_attributes (Lisp_Object pid) { @@ -3748,18 +3752,6 @@ system_process_attributes (Lisp_Object pid) #elif defined DARWIN_OS -static struct timespec -timeval_to_timespec (struct timeval t) -{ - return make_timespec (t.tv_sec, t.tv_usec * 1000); -} - -static Lisp_Object -make_lisp_timeval (struct timeval t) -{ - return make_lisp_time (timeval_to_timespec (t)); -} - Lisp_Object system_process_attributes (Lisp_Object pid) { |