diff options
| author | Paul Eggert | 2018-10-03 09:10:00 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-10-06 23:31:03 -0700 |
| commit | 0faad0a0025cb4c6cbdba44e5b259690fae27b1a (patch) | |
| tree | 4d4e3e6709e02d03244457107d0a59e6cb4d26ff /src | |
| parent | b5d08da1e9ea7ee1334d810348c656babe6a15d2 (diff) | |
| download | emacs-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.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) | |||
| 3047 | 3047 | ||
| 3048 | #endif /* !defined (WINDOWSNT) */ | 3048 | #endif /* !defined (WINDOWSNT) */ |
| 3049 | 3049 | ||
| 3050 | |||
| 3051 | #if defined __FreeBSD__ || defined DARWIN_OS | ||
| 3052 | |||
| 3053 | static struct timespec | ||
| 3054 | timeval_to_timespec (struct timeval t) | ||
| 3055 | { | ||
| 3056 | return make_timespec (t.tv_sec, t.tv_usec * 1000); | ||
| 3057 | } | ||
| 3058 | static Lisp_Object | ||
| 3059 | make_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 |
| 3051 | static struct timespec | 3067 | static struct timespec |
| 3052 | time_from_jiffies (unsigned long long tval, long hz) | 3068 | time_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 | ||
| 3570 | static struct timespec | ||
| 3571 | timeval_to_timespec (struct timeval t) | ||
| 3572 | { | ||
| 3573 | return make_timespec (t.tv_sec, t.tv_usec * 1000); | ||
| 3574 | } | ||
| 3575 | |||
| 3576 | static Lisp_Object | ||
| 3577 | make_lisp_timeval (struct timeval t) | ||
| 3578 | { | ||
| 3579 | return make_lisp_time (timeval_to_timespec (t)); | ||
| 3580 | } | ||
| 3581 | |||
| 3582 | Lisp_Object | 3586 | Lisp_Object |
| 3583 | system_process_attributes (Lisp_Object pid) | 3587 | system_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 | ||
| 3751 | static struct timespec | ||
| 3752 | timeval_to_timespec (struct timeval t) | ||
| 3753 | { | ||
| 3754 | return make_timespec (t.tv_sec, t.tv_usec * 1000); | ||
| 3755 | } | ||
| 3756 | |||
| 3757 | static Lisp_Object | ||
| 3758 | make_lisp_timeval (struct timeval t) | ||
| 3759 | { | ||
| 3760 | return make_lisp_time (timeval_to_timespec (t)); | ||
| 3761 | } | ||
| 3762 | |||
| 3763 | Lisp_Object | 3755 | Lisp_Object |
| 3764 | system_process_attributes (Lisp_Object pid) | 3756 | system_process_attributes (Lisp_Object pid) |
| 3765 | { | 3757 | { |