aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2018-10-03 09:10:00 -0700
committerPaul Eggert2018-10-06 23:31:03 -0700
commit0faad0a0025cb4c6cbdba44e5b259690fae27b1a (patch)
tree4d4e3e6709e02d03244457107d0a59e6cb4d26ff /src
parentb5d08da1e9ea7ee1334d810348c656babe6a15d2 (diff)
downloademacs-0faad0a0025cb4c6cbdba44e5b259690fae27b1a.tar.gz
emacs-0faad0a0025cb4c6cbdba44e5b259690fae27b1a.zip
Coalesce duplicate make_lisp_timeval etc.
* src/sysdep.c (timeval_to_timespec, make_lisp_timeval): Coalesce duplicate definitions (Bug#32902).
Diffstat (limited to 'src')
-rw-r--r--src/sysdep.c40
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)
3047 3047
3048#endif /* !defined (WINDOWSNT) */ 3048#endif /* !defined (WINDOWSNT) */
3049 3049
3050
3051#if defined __FreeBSD__ || defined DARWIN_OS
3052
3053static struct timespec
3054timeval_to_timespec (struct timeval t)
3055{
3056 return make_timespec (t.tv_sec, t.tv_usec * 1000);
3057}
3058static Lisp_Object
3059make_lisp_timeval (struct timeval t)
3060{
3061 return make_lisp_time (timeval_to_timespec (t));
3062}
3063
3064#endif
3065
3050#if defined GNU_LINUX && defined HAVE_LONG_LONG_INT 3066#if defined GNU_LINUX && defined HAVE_LONG_LONG_INT
3051static struct timespec 3067static struct timespec
3052time_from_jiffies (unsigned long long tval, long hz) 3068time_from_jiffies (unsigned long long tval, long hz)
@@ -3567,18 +3583,6 @@ system_process_attributes (Lisp_Object pid)
3567 3583
3568#elif defined __FreeBSD__ 3584#elif defined __FreeBSD__
3569 3585
3570static struct timespec
3571timeval_to_timespec (struct timeval t)
3572{
3573 return make_timespec (t.tv_sec, t.tv_usec * 1000);
3574}
3575
3576static Lisp_Object
3577make_lisp_timeval (struct timeval t)
3578{
3579 return make_lisp_time (timeval_to_timespec (t));
3580}
3581
3582Lisp_Object 3586Lisp_Object
3583system_process_attributes (Lisp_Object pid) 3587system_process_attributes (Lisp_Object pid)
3584{ 3588{
@@ -3748,18 +3752,6 @@ system_process_attributes (Lisp_Object pid)
3748 3752
3749#elif defined DARWIN_OS 3753#elif defined DARWIN_OS
3750 3754
3751static struct timespec
3752timeval_to_timespec (struct timeval t)
3753{
3754 return make_timespec (t.tv_sec, t.tv_usec * 1000);
3755}
3756
3757static Lisp_Object
3758make_lisp_timeval (struct timeval t)
3759{
3760 return make_lisp_time (timeval_to_timespec (t));
3761}
3762
3763Lisp_Object 3755Lisp_Object
3764system_process_attributes (Lisp_Object pid) 3756system_process_attributes (Lisp_Object pid)
3765{ 3757{