From: Paul Eggert Date: Wed, 3 Oct 2018 16:10:00 +0000 (-0700) Subject: Coalesce duplicate make_lisp_timeval etc. X-Git-Tag: emacs-27.0.90~4336 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0faad0a0025cb4c6cbdba44e5b259690fae27b1a;p=emacs.git Coalesce duplicate make_lisp_timeval etc. * src/sysdep.c (timeval_to_timespec, make_lisp_timeval): Coalesce duplicate definitions (Bug#32902). --- 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) {