View | Details | Raw Unified | Return to bug 171866
Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	mcelog
8
PORTNAME=	mcelog
9
DISTVERSION=	1.0pre2
9
DISTVERSION=	1.0pre3
10
CATEGORIES=	sysutils
10
CATEGORIES=	sysutils
11
MASTER_SITES=	ftp://ftp.kernel.org/pub/linux/utils/cpu/mce/ \
11
MASTER_SITES=	ftp://ftp.kernel.org/pub/linux/utils/cpu/mce/ \
12
		http://147.52.159.12/mirrors/ftp.kernel.org/pub/linux/utils/cpu/mce/ \
12
		http://147.52.159.12/mirrors/ftp.kernel.org/pub/linux/utils/cpu/mce/ \
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (mcelog-1.0pre2.tar.gz) = 39bec2a19e2548afe9dbc80f6f9dcee6664fffa7ccc142aeb5e1f8c217c1705c
1
SHA256 (mcelog-1.0pre3.tar.gz) = 0782e0aa952fa4bd641071e6b501774a63993a813a4f494ffd7819521a13c50c
2
SIZE (mcelog-1.0pre2.tar.gz) = 174553
2
SIZE (mcelog-1.0pre3.tar.gz) = 176649
(-)pkg-descr (-3 / +6 lines)
Lines 4-12 Link Here
4
4
5
This software is heavily patched to work on FreeBSD systems,
5
This software is heavily patched to work on FreeBSD systems,
6
and thus provides an extremely limited subset of features as
6
and thus provides an extremely limited subset of features as
7
of this writing.  The primary purpose is to provide a way to
7
of this writing (for example, daemon mode is not currently
8
decode MCE output from the FreeBSD kernel into something more
8
supported).
9
human-readable using the command 'mcelog --no-dmi --ascii'
9
10
The primary purpose is to provide a way to decode MCE output
11
from the FreeBSD kernel into something more human-readable
12
using the command 'mcelog --no-dmi --ascii'.
10
13
11
FreeBSD conversion patches were originally written by John
14
FreeBSD conversion patches were originally written by John
12
Baldwin <jhb@freebsd.org> and later incorporated into this
15
Baldwin <jhb@freebsd.org> and later incorporated into this
(-)pkg-message (-5 / +10 lines)
Lines 1-7 Link Here
1
=================================================
1
======================================================
2
You can decode MCE output from the FreeBSD kernel
2
You can decode MCE output from the FreeBSD kernel by
3
by using the following command:
3
using the following command:
4
4
5
mcelog --no-dmi --ascii --file /path/to/log
5
  mcelog --no-dmi --ascii --file /path/to/log
6
6
7
=================================================
7
Or if you wish to paste the MCE via stdin:
8
9
  mcelog --no-dmi --ascii
10
  {...paste MCE and send EOF/press Ctrl-D...}
11
12
======================================================
(-)files/patch-Makefile (-7 / +8 lines)
Lines 1-5 Link Here
1
--- ./Makefile.orig	2009-12-15 07:18:40.000000000 -0500
1
--- Makefile.orig	2010-01-20 18:36:52.000000000 -0800
2
+++ ./Makefile	2011-10-14 22:36:47.000000000 -0400
2
+++ Makefile	2012-09-22 01:50:21.019688386 -0700
3
@@ -1,5 +1,5 @@
3
@@ -1,5 +1,5 @@
4
 CFLAGS := -g -Os
4
 CFLAGS := -g -Os
5
-prefix := /usr
5
-prefix := /usr
Lines 7-13 Link Here
7
 etcprefix :=
7
 etcprefix :=
8
 # Define appropiately for your distribution
8
 # Define appropiately for your distribution
9
 # DOCDIR := /usr/share/doc/packages/mcelog
9
 # DOCDIR := /usr/share/doc/packages/mcelog
10
@@ -28,10 +28,18 @@
10
@@ -28,11 +28,18 @@
11
 
11
 
12
 .PHONY: install clean depend
12
 .PHONY: install clean depend
13
 
13
 
Lines 15-23 Link Here
15
 OBJ := p4.o k8.o mcelog.o dmi.o tsc.o core2.o bitfield.o intel.o \
15
 OBJ := p4.o k8.o mcelog.o dmi.o tsc.o core2.o bitfield.o intel.o \
16
        nehalem.o dunnington.o tulsa.o config.o memutil.o msg.o   \
16
        nehalem.o dunnington.o tulsa.o config.o memutil.o msg.o   \
17
-       eventloop.o leaky-bucket.o memdb.o server.o trigger.o 	 \
17
-       eventloop.o leaky-bucket.o memdb.o server.o trigger.o 	 \
18
-       client.o cache.o sysfs.o yellow.o page.o rbtree.o
18
-       client.o cache.o sysfs.o yellow.o page.o rbtree.o 	 \
19
-       xeon75xx.o
19
+       eventloop.o leaky-bucket.o memdb.o server.o client.o 	 \
20
+       eventloop.o leaky-bucket.o memdb.o server.o client.o 	 \
20
+       cache.o rbtree.o
21
+       cache.o rbtree.o xeon75xx.o
21
+ifndef FREEBSD
22
+ifndef FREEBSD
22
+OBJ += page.o trigger.o sysfs.o yellow.o
23
+OBJ += page.o trigger.o sysfs.o yellow.o
23
+endif
24
+endif
Lines 28-34 Link Here
28
 DISKDB_OBJ := diskdb.o dimm.o db.o
29
 DISKDB_OBJ := diskdb.o dimm.o db.o
29
 CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ}
30
 CLEAN := mcelog dmi tsc dbquery .depend .depend.X dbquery.o ${DISKDB_OBJ}
30
 DOC := mce.pdf
31
 DOC := mce.pdf
31
@@ -47,7 +55,7 @@
32
@@ -48,7 +55,7 @@
32
 
33
 
33
 SRC := $(OBJ:.o=.c)
34
 SRC := $(OBJ:.o=.c)
34
 
35
 
Lines 37-43 Link Here
37
 
38
 
38
 # dbquery intentionally not installed by default
39
 # dbquery intentionally not installed by default
39
 install: mcelog
40
 install: mcelog
40
@@ -81,8 +89,6 @@
41
@@ -82,8 +89,6 @@
41
 .depend: ${SRC}
42
 .depend: ${SRC}
42
 	${CC} -MM -I. ${SRC} > .depend.X && mv .depend.X .depend
43
 	${CC} -MM -I. ${SRC} > .depend.X && mv .depend.X .depend
43
 
44
 
(-)files/patch-config.c (-3 / +16 lines)
Lines 1-5 Link Here
1
--- ./config.c.orig	2009-12-15 07:18:40.000000000 -0500
1
--- config.c.orig	2010-01-20 18:36:52.000000000 -0800
2
+++ ./config.c	2011-10-14 22:36:47.000000000 -0400
2
+++ config.c	2012-09-22 02:32:52.718116009 -0700
3
@@ -18,6 +18,9 @@
3
@@ -18,6 +18,9 @@
4
    Author: Andi Kleen 
4
    Author: Andi Kleen 
5
 */
5
 */
Lines 10-16 Link Here
10
 #include <stdio.h>
10
 #include <stdio.h>
11
 #include <string.h>
11
 #include <string.h>
12
 #include <ctype.h>
12
 #include <ctype.h>
13
@@ -126,6 +129,21 @@
13
@@ -127,6 +130,21 @@
14
 	return s;
14
 	return s;
15
 }
15
 }
16
 
16
 
Lines 32-34 Link Here
32
 int parse_config_file(const char *fn)
32
 int parse_config_file(const char *fn)
33
 {
33
 {
34
 	FILE *f;
34
 	FILE *f;
35
@@ -304,7 +322,12 @@
36
 	s = config_string(header, name);
37
 	if (s) { 
38
 		/* no $PATH */
39
+#ifdef __Linux_
40
 		if (trigger_check(s) != 0) {
41
+#endif
42
+#ifdef __FreeBSD__
43
+		if (access(s, R_OK|X_OK) != 0) {
44
+#endif
45
 			SYSERRprintf("Trigger `%s' not executable\n", s);
46
 			exit(1);
47
 		}
(-)files/patch-eventloop.c (-7 / +15 lines)
Lines 1-5 Link Here
1
--- ./eventloop.c.orig	2009-12-15 07:18:40.000000000 -0500
1
--- eventloop.c.orig	2010-01-20 18:36:52.000000000 -0800
2
+++ ./eventloop.c	2011-10-14 22:36:47.000000000 -0400
2
+++ eventloop.c	2012-09-22 02:25:13.281116126 -0700
3
@@ -38,7 +38,9 @@
3
@@ -38,7 +38,9 @@
4
 static struct pollfd pollfds[MAX_POLLFD];
4
 static struct pollfd pollfds[MAX_POLLFD];
5
 static struct pollcb pollcbs[MAX_POLLFD];	
5
 static struct pollcb pollcbs[MAX_POLLFD];	
Lines 18-34 Link Here
18
 int event_signal(int sig)
18
 int event_signal(int sig)
19
 {
19
 {
20
 	static int first = 1;
20
 	static int first = 1;
21
@@ -111,11 +114,17 @@
21
@@ -126,17 +129,25 @@
22
 		return -1;
22
 
23
 	return 0;
23
 static int (*ppoll_vec)(struct pollfd *, nfds_t, const struct timespec
24
 }
24
 			*, const sigset_t *);
25
+#endif
25
+#endif
26
 
26
 
27
 void eventloop(void)
27
 void eventloop(void)
28
 {
28
 {
29
+#ifdef __Linux__
30
 #if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 5 || __GLIBC__ > 2
31
 	ppoll_vec = ppoll;
32
 #endif
33
 	if (!ppoll_vec) 
34
 		ppoll_vec = ppoll_fallback;
35
+#endif
36
 
29
 	for (;;) { 
37
 	for (;;) { 
30
+#ifdef __Linux__
38
+#ifdef __Linux__
31
 		int n = ppoll(pollfds, max_pollfd, NULL, &event_sigs);
39
 		int n = ppoll_vec(pollfds, max_pollfd, NULL, &event_sigs);
32
+#endif
40
+#endif
33
+#ifdef __FreeBSD__
41
+#ifdef __FreeBSD__
34
+		int n = poll(pollfds, max_pollfd, -1);
42
+		int n = poll(pollfds, max_pollfd, -1);
(-)files/patch-intel.c (-9 / +18 lines)
Lines 1-21 Link Here
1
--- ./intel.c.orig	2009-12-15 07:18:40.000000000 -0500
1
--- intel.c.orig	2010-01-20 18:36:52.000000000 -0800
2
+++ ./intel.c	2011-10-14 22:36:47.000000000 -0400
2
+++ intel.c	2012-09-22 01:58:40.204115724 -0700
3
@@ -38,7 +38,7 @@
3
@@ -43,7 +43,7 @@
4
 			return CPU_CORE2;
4
 			return CPU_CORE2;
5
 		else if (model == 0x1d)
5
 		else if (model == 0x1d)
6
 			return CPU_DUNNINGTON;
6
 			return CPU_DUNNINGTON;
7
-		else if (model == 0x1a)
7
-		else if (model == 0x1a)
8
+		else if (model == 0x1a || model == 0x2c) /* Nehalem/Westmere */
8
+		else if (model == 0x1a || model == 0x2c) /* Nehalem/Westmere */
9
 			return CPU_NEHALEM;
9
 			return CPU_NEHALEM;
10
 
10
 		else if (model == 0x2e)
11
 		if (model >= 0x1a) 
11
 			return CPU_XEON75XX;
12
@@ -79,7 +79,9 @@
12
@@ -94,14 +94,18 @@
13
 		if (recordlen > offsetof(struct mce, mcgcap) && m->mcgcap & MCG_CMCI_P)
13
  			corr_err_cnt = EXTRACT(m->status, 38, 52);
14
  			corr_err_cnt = EXTRACT(m->status, 38, 52);
14
 		memory_error(m, channel, dimm, corr_err_cnt, recordlen);
15
 		memory_error(m, channel[0], dimm[0], corr_err_cnt, recordlen);
16
+#ifdef __Linux__
17
 		account_page_error(m, channel[0], dimm[0]);
18
+#endif
15
 
19
 
20
 		/* 
21
 		 * When both DIMMs have a error account the error twice to the page.
22
 		 */
23
 		if (channel[1] != -1) {
24
 			memory_error(m, channel[1], dimm[1], corr_err_cnt, recordlen);
16
+#ifdef __Linux__
25
+#ifdef __Linux__
17
 		account_page_error(m, channel, dimm, corr_err_cnt);
26
 			account_page_error(m, channel[1], dimm[1]);
18
+#endif
27
+#endif
28
 		}
19
 
29
 
20
 		return 1;
30
 		return 1;
21
 	}
(-)files/patch-mcelog.c (-40 / +41 lines)
Lines 1-12 Link Here
1
--- ./mcelog.c.orig	2009-12-15 07:18:40.000000000 -0500
1
--- mcelog.c.orig	2010-01-20 18:36:52.000000000 -0800
2
+++ ./mcelog.c	2011-10-14 22:37:22.000000000 -0400
2
+++ mcelog.c	2012-09-22 02:34:19.182116917 -0700
3
@@ -20,8 +20,21 @@
3
@@ -20,9 +20,22 @@
4
 #define _GNU_SOURCE 1
4
 #define _GNU_SOURCE 1
5
 #include <sys/fcntl.h>
5
 #include <sys/fcntl.h>
6
 #include <sys/ioctl.h>
6
 #include <sys/ioctl.h>
7
+#ifdef __Linux__
7
+#ifdef __Linux__
8
 #include <asm/types.h>
8
 #include <asm/types.h>
9
 #include <asm/ioctls.h>
9
 #include <asm/ioctls.h>
10
 #include <linux/limits.h>
10
+#endif
11
+#endif
11
+#ifdef __FreeBSD__
12
+#ifdef __FreeBSD__
12
+#include <sys/types.h>
13
+#include <sys/types.h>
Lines 22-43 Link Here
22
 #include <stdlib.h>
23
 #include <stdlib.h>
23
 #include <stdio.h>
24
 #include <stdio.h>
24
 #include <string.h>
25
 #include <string.h>
25
@@ -57,9 +70,25 @@
26
@@ -58,9 +71,25 @@
26
 #include "yellow.h"
27
 #include "yellow.h"
27
 #include "page.h"
28
 #include "page.h"
28
 
29
 
29
+struct mca_record {
30
+struct mca_record {
30
+        uint64_t        mr_status;
31
+	uint64_t	mr_status;
31
+        uint64_t        mr_addr;
32
+	uint64_t	mr_addr;
32
+        uint64_t        mr_misc;
33
+	uint64_t	mr_misc;
33
+        uint64_t        mr_tsc;
34
+	uint64_t	mr_tsc;
34
+        int             mr_apic_id;
35
+	int		mr_apic_id;
35
+        int             mr_bank;
36
+	int		mr_bank;
36
+        uint64_t        mr_mcg_cap;
37
+	uint64_t	mr_mcg_cap;
37
+        uint64_t        mr_mcg_status;
38
+	uint64_t	mr_mcg_status;
38
+        int             mr_cpu_id;
39
+	int		mr_cpu_id;
39
+        int             mr_cpu_vendor_id;
40
+	int		mr_cpu_vendor_id;
40
+        int             mr_cpu;
41
+	int		mr_cpu;
41
+};
42
+};
42
+
43
+
43
 enum cputype cputype = CPU_GENERIC;	
44
 enum cputype cputype = CPU_GENERIC;	
Lines 48-54 Link Here
48
 
49
 
49
 int ignore_nodev;
50
 int ignore_nodev;
50
 int filter_bogus = 1;
51
 int filter_bogus = 1;
51
@@ -70,12 +99,18 @@
52
@@ -71,12 +100,18 @@
52
 int dump_raw_ascii;
53
 int dump_raw_ascii;
53
 int daemon_mode;
54
 int daemon_mode;
54
 static char *inputfile;
55
 static char *inputfile;
Lines 67-73 Link Here
67
 
68
 
68
 static void check_cpu(void);
69
 static void check_cpu(void);
69
 
70
 
70
@@ -388,6 +423,7 @@
71
@@ -393,6 +428,7 @@
71
 	Wprintf("\n");
72
 	Wprintf("\n");
72
 }
73
 }
73
 
74
 
Lines 75-81 Link Here
75
 void check_cpu(void)
76
 void check_cpu(void)
76
 { 
77
 { 
77
 	enum { 
78
 	enum { 
78
@@ -455,7 +491,44 @@
79
@@ -460,7 +496,45 @@
79
 	} else
80
 	} else
80
 		Eprintf("warning: Cannot open /proc/cpuinfo\n");
81
 		Eprintf("warning: Cannot open /proc/cpuinfo\n");
81
 } 
82
 } 
Lines 92-97 Link Here
92
+
93
+
93
+	if (checked)
94
+	if (checked)
94
+		return;
95
+		return;
96
+
95
+	checked = 1;
97
+	checked = 1;
96
+
98
+
97
+	do_cpuid(0, regs);
99
+	do_cpuid(0, regs);
Lines 104-126 Link Here
104
+	cpu_id = regs[0];
106
+	cpu_id = regs[0];
105
+	family = CPUID_TO_FAMILY(cpu_id);
107
+	family = CPUID_TO_FAMILY(cpu_id);
106
+	model = CPUID_TO_MODEL(cpu_id);
108
+	model = CPUID_TO_MODEL(cpu_id);
107
 
109
+
108
+	if (cpu_forced) 
110
+	if (cpu_forced)
109
+		;
111
+		;
110
+	else if (!strcmp(vendor,"AuthenticAMD") && 
112
+	else if (!strcmp(vendor,"AuthenticAMD") &&
111
+	    (family == 15 || family == 16 || family == 17))
113
+	    (family == 15 || family == 16 || family == 17))
112
+		cputype = CPU_K8;
114
+		cputype = CPU_K8;
113
+	else if (!strcmp(vendor,"GenuineIntel"))
115
+	else if (!strcmp(vendor,"GenuineIntel"))
114
+		cputype = select_intel_cputype(family, model);
116
+		cputype = select_intel_cputype(family, model);
115
+	/* Add checks for other CPUs here */	
117
+	/* Add checks for other CPUs here */
116
+}
118
+}
117
+#endif
119
+#endif
118
+
120
 
119
+#ifdef __Linux__
121
+#ifdef __Linux__
120
 static char *skipspace(char *s)
122
 static char *skipspace(char *s)
121
 {
123
 {
122
 	while (isspace(*s))
124
 	while (isspace(*s))
123
@@ -479,6 +552,7 @@
125
@@ -484,6 +558,7 @@
124
 	}
126
 	}
125
 	return skipspace(s);
127
 	return skipspace(s);
126
 }
128
 }
Lines 128-142 Link Here
128
 
130
 
129
 static void dump_mce_final(struct mce *m, char *symbol, int missing, int recordlen, 
131
 static void dump_mce_final(struct mce *m, char *symbol, int missing, int recordlen, 
130
 			   int dseen)
132
 			   int dseen)
131
@@ -501,6 +575,7 @@
133
@@ -507,6 +582,7 @@
132
 	if (recordlen < endof_field(struct mce, f)) \
133
 		recordlen = endof_field(struct mce, f)
134
 		recordlen = endof_field(struct mce, f)
134
 
135
 
135
+#ifdef __Linux__
136
 /* Decode ASCII input for fatal messages */
136
 /* Decode ASCII input for fatal messages */
137
+#ifdef __Linux__
137
 static void decodefatal(FILE *inf)
138
 static void decodefatal(FILE *inf)
138
 {
139
 {
139
@@ -646,6 +721,227 @@
140
 	struct mce m;
141
@@ -651,6 +727,227 @@
140
 	if (data)
142
 	if (data)
141
 		dump_mce_final(&m, symbol, missing, recordlen, disclaimer_seen);
143
 		dump_mce_final(&m, symbol, missing, recordlen, disclaimer_seen);
142
 }
144
 }
Lines 364-381 Link Here
364
 
366
 
365
 static void remove_pidfile(void)
367
 static void remove_pidfile(void)
366
 {
368
 {
367
@@ -686,6 +982,10 @@
369
@@ -709,6 +1006,10 @@
368
 "  mcelog [options] --ascii < log\n"
370
 "  mcelog [options] --ascii < log\n"
369
 "  mcelog [options] --ascii --file log\n"
371
 "  mcelog [options] --ascii --file log\n"
370
 "Decode machine check ASCII output from kernel logs\n"
372
 "Decode machine check ASCII output from kernel logs\n"
371
+#ifdef __FreeBSD__
373
+#ifdef __FreeBSD_
372
+"  mcelog [options] -M vmcore -N kernel\n"
374
+"  mcelog [options] -M vmcore -N kernel\n"
373
+"Decode machine check error records from kernel crashdump.\n"
375
+"Decode machine check error records from kernel crashdump.\n"
374
+#endif
376
+#endif
375
 "Options:\n"  
377
 "Options:\n"  
376
 "--cpu CPU           Set CPU type CPU to decode (see below for valid types)\n"
378
 "--cpu CPU           Set CPU type CPU to decode (see below for valid types)\n"
377
 "--cpumhz MHZ        Set CPU Mhz to decode time (output unreliable, not needed on new kernels)\n"
379
 "--cpumhz MHZ        Set CPU Mhz to decode time (output unreliable, not needed on new kernels)\n"
378
@@ -866,6 +1166,14 @@
380
@@ -889,6 +1190,14 @@
379
 	case O_CONFIG_FILE:
381
 	case O_CONFIG_FILE:
380
 		/* parsed in config.c */
382
 		/* parsed in config.c */
381
 		break;
383
 		break;
Lines 390-396 Link Here
390
 	case 0:
392
 	case 0:
391
 		break;
393
 		break;
392
 	default:
394
 	default:
393
@@ -900,8 +1208,10 @@
395
@@ -923,8 +1232,10 @@
394
 
396
 
395
 static void general_setup(void)
397
 static void general_setup(void)
396
 {
398
 {
Lines 401-407 Link Here
401
 	config_cred("global", "run-credentials", &runcred);
403
 	config_cred("global", "run-credentials", &runcred);
402
 	if (config_bool("global", "filter-memory-errors") == 1)
404
 	if (config_bool("global", "filter-memory-errors") == 1)
403
 		filter_memory_errors = 1;
405
 		filter_memory_errors = 1;
404
@@ -924,6 +1234,7 @@
406
@@ -947,6 +1258,7 @@
405
 	}
407
 	}
406
 }
408
 }
407
 
409
 
Lines 409-415 Link Here
409
 static void process(int fd, unsigned recordlen, unsigned loglen, char *buf)
411
 static void process(int fd, unsigned recordlen, unsigned loglen, char *buf)
410
 {	
412
 {	
411
 	int i; 
413
 	int i; 
412
@@ -964,6 +1275,173 @@
414
@@ -987,6 +1299,173 @@
413
 	if (finish)
415
 	if (finish)
414
 		exit(0);
416
 		exit(0);
415
 }
417
 }
Lines 583-589 Link Here
583
 
585
 
584
 static void noargs(int ac, char **av)
586
 static void noargs(int ac, char **av)
585
 {
587
 {
586
@@ -1022,22 +1500,30 @@
588
@@ -1045,22 +1524,30 @@
587
 	char *buf;
589
 	char *buf;
588
 };
590
 };
589
 
591
 
Lines 607-622 Link Here
607
 
609
 
608
 	parse_config(av);
610
 	parse_config(av);
609
 
611
 
610
-	while ((opt = getopt_long(ac, av, "", options, NULL)) != -1) { 
611
+#ifdef __FreeBSD__
612
+#ifdef __FreeBSD__
612
+	while ((opt = getopt_long(ac, av, "M:N:", options, NULL)) != -1) {
613
+	while ((opt = getopt_long(ac, av, "M:N:", options, NULL)) != -1) { 
613
+#else
614
+#else
614
+	while ((opt = getopt_long(ac, av, "", options, NULL)) != -1) {
615
 	while ((opt = getopt_long(ac, av, "", options, NULL)) != -1) { 
615
+#endif
616
+#endif
616
 		if (opt == '?') {
617
 		if (opt == '?') {
617
 			usage(); 
618
 			usage(); 
618
 		} else if (combined_modifier(opt) > 0) {
619
 		} else if (combined_modifier(opt) > 0) {
619
@@ -1057,13 +1543,21 @@
620
@@ -1080,13 +1567,21 @@
620
 		} else if (opt == 0)
621
 		} else if (opt == 0)
621
 			break;		    
622
 			break;		    
622
 	} 
623
 	} 
Lines 638-644 Link Here
638
 	fd = open(logfn, O_RDONLY); 
639
 	fd = open(logfn, O_RDONLY); 
639
 	if (fd < 0) {
640
 	if (fd < 0) {
640
 		if (ignore_nodev) 
641
 		if (ignore_nodev) 
641
@@ -1078,24 +1572,39 @@
642
@@ -1101,24 +1596,39 @@
642
 		err("MCE_GET_LOG_LEN");
643
 		err("MCE_GET_LOG_LEN");
643
 
644
 
644
 	d.buf = xalloc(d.recordlen * d.loglen); 
645
 	d.buf = xalloc(d.recordlen * d.loglen); 
(-)files/patch-server.c (-2 / +15 lines)
Lines 1-5 Link Here
1
--- ./server.c.orig	2009-12-15 07:18:40.000000000 -0500
1
--- server.c.orig	2010-01-20 18:36:52.000000000 -0800
2
+++ ./server.c	2011-10-14 22:36:47.000000000 -0400
2
+++ server.c	2012-09-22 02:39:04.991117023 -0700
3
@@ -101,7 +101,9 @@
3
@@ -101,7 +101,9 @@
4
 
4
 
5
 static void dispatch_pages(FILE *fh)
5
 static void dispatch_pages(FILE *fh)
Lines 77-79 Link Here
77
 
77
 
78
 	cc = xalloc(sizeof(struct clientcon));
78
 	cc = xalloc(sizeof(struct clientcon));
79
 	if (register_pollcb(nfd, POLLIN, client_event, cc) < 0) {
79
 	if (register_pollcb(nfd, POLLIN, client_event, cc) < 0) {
80
@@ -300,7 +336,12 @@
81
 	sigaction(SIGALRM, &sa, &oldsa);	
82
 	if (sigsetjmp(ping_timeout_ctx, 1) == 0) {
83
 		alarm(initial_ping_timeout);
84
+#ifdef __Linux__
85
 		if (connect(fd, un, sizeof(struct sockaddr_un)) < 0)
86
+#endif
87
+#ifdef __FreeBSD__
88
+		if (connect(fd, (struct sockaddr *) un, sizeof(struct sockaddr_un)) < 0)
89
+#endif
90
 			goto cleanup;
91
 		if (write(fd, PAIR("ping\n")) < 0)
92
 			goto cleanup;

Return to bug 171866