diff options
| author | Paul Eggert | 2013-03-05 13:56:36 -0800 |
|---|---|---|
| committer | Paul Eggert | 2013-03-05 13:56:36 -0800 |
| commit | 9b1c32713812fa4e0085583469d9f739b7943d50 (patch) | |
| tree | 0dbe396edda203ceebed8e267abc7e383c9771d9 /src | |
| parent | 3b108d19a0fd9aaa37709d0be4bfc67884120f43 (diff) | |
| download | emacs-9b1c32713812fa4e0085583469d9f739b7943d50.tar.gz emacs-9b1c32713812fa4e0085583469d9f739b7943d50.zip | |
Fix a build failure on OpenBSD 4.x and MirBSD.
* sysdep.c (list_system_processes) [__OpenBSD__ || __MirBSD__]:
Make it a stub in this case; otherwise the build might fail,
and even if the build worked the function would just return nil anyway.
Problem reported by Nelson H. F. Beebe in
<http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
and analyzed by Jérémie Courrèges-Anglas in
<http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
Fixes: debbugs:13881
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/sysdep.c | 14 |
2 files changed, 9 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 91dc8b6d8c9..18b22b5da46 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,12 +1,13 @@ | |||
| 1 | 2013-03-05 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2013-03-05 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Fix a build failure on OpenBSD 4.x and MirBSD. | 3 | Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881). |
| 4 | * sysdep.c (KERN_PROC, kinfo_proc) | 4 | * sysdep.c (list_system_processes) [__OpenBSD__ || __MirBSD__]: |
| 5 | [BSD_SYSTEM && (!KERN_PROC || __MirBSD__)]: | 5 | Make it a stub in this case; otherwise the build might fail, |
| 6 | Define to KERN_PROC2 and kinfo_proc2, for OpenBSD 4.9 and MirBSD. | 6 | and even if the build worked the function would just return nil anyway. |
| 7 | list-system-processes still returns nil, but at least it doesn't crash. | ||
| 8 | Problem reported by Nelson H. F. Beebe in | 7 | Problem reported by Nelson H. F. Beebe in |
| 9 | <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>. | 8 | <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html> |
| 9 | and analyzed by Jérémie Courrèges-Anglas in | ||
| 10 | <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>. | ||
| 10 | 11 | ||
| 11 | 2013-03-02 Andreas Schwab <schwab@linux-m68k.org> | 12 | 2013-03-02 Andreas Schwab <schwab@linux-m68k.org> |
| 12 | 13 | ||
diff --git a/src/sysdep.c b/src/sysdep.c index 9eba9e86819..80c7e0bc51e 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -2647,20 +2647,12 @@ list_system_processes (void) | |||
| 2647 | return proclist; | 2647 | return proclist; |
| 2648 | } | 2648 | } |
| 2649 | 2649 | ||
| 2650 | #elif defined BSD_SYSTEM | 2650 | #elif defined BSD_SYSTEM && !defined __OpenBSD__ && !defined __MirBSD__ |
| 2651 | |||
| 2652 | /* OpenBSD 4.9 and earlier do not have KERN_PROC. Approximate it with | ||
| 2653 | KERN_PROC2. MirBSD's KERN_PROC seems to be busted. */ | ||
| 2654 | # if !defined KERN_PROC || defined __MirBSD__ | ||
| 2655 | # undef KERN_PROC | ||
| 2656 | # define KERN_PROC KERN_PROC2 | ||
| 2657 | # define kinfo_proc kinfo_proc2 | ||
| 2658 | # endif | ||
| 2659 | 2651 | ||
| 2660 | Lisp_Object | 2652 | Lisp_Object |
| 2661 | list_system_processes (void) | 2653 | list_system_processes (void) |
| 2662 | { | 2654 | { |
| 2663 | #if defined DARWIN_OS || defined __NetBSD__ || defined __OpenBSD__ | 2655 | #if defined DARWIN_OS || defined __NetBSD__ |
| 2664 | int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; | 2656 | int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; |
| 2665 | #else | 2657 | #else |
| 2666 | int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC}; | 2658 | int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC}; |
| @@ -2688,8 +2680,6 @@ list_system_processes (void) | |||
| 2688 | { | 2680 | { |
| 2689 | #if defined DARWIN_OS || defined __NetBSD__ | 2681 | #if defined DARWIN_OS || defined __NetBSD__ |
| 2690 | proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist); | 2682 | proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist); |
| 2691 | #elif defined __OpenBSD__ | ||
| 2692 | proclist = Fcons (make_fixnum_or_float (procs[i].p_pid), proclist); | ||
| 2693 | #else | 2683 | #else |
| 2694 | proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist); | 2684 | proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist); |
| 2695 | #endif | 2685 | #endif |