View | Details | Raw Unified | Return to bug 246357 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/cciss_vol_status/Makefile (-2 / +3 lines)
Lines 3-12 Link Here
3
3
4
PORTNAME=	cciss_vol_status
4
PORTNAME=	cciss_vol_status
5
PORTVERSION=	1.12
5
PORTVERSION=	1.12
6
PORTREVISION=	1
6
CATEGORIES=	sysutils
7
CATEGORIES=	sysutils
7
MASTER_SITES=	SF/cciss/${PORTNAME}
8
MASTER_SITES=	SF/cciss/${PORTNAME}
8
9
9
MAINTAINER=	fw@moov.de
10
MAINTAINER=	pen@lysator.liu.se
10
COMMENT=	Reports status of logical drives on ciss(4) controllers
11
COMMENT=	Reports status of logical drives on ciss(4) controllers
11
12
12
LICENSE=	GPLv2
13
LICENSE=	GPLv2
Lines 18-24 Link Here
18
SUB_FILES=	cciss_vol_status
19
SUB_FILES=	cciss_vol_status
19
20
20
.if !exists(${SRC_BASE}/sys/dev/ciss/cissio.h)
21
.if !exists(${SRC_BASE}/sys/dev/ciss/cissio.h)
21
IGNORE=		cciss_vol_status requires kernel sources of the ciss driver
22
IGNORE+=	cciss_vol_status requires kernel sources of the ciss driver
22
.endif
23
.endif
23
24
24
post-install:
25
post-install:
(-)sysutils/cciss_vol_status/files/patch-cciss_vol_status.c (-3 / +108 lines)
Lines 1-6 Link Here
1
--- cciss_vol_status.c.orig	2017-10-18 07:49:43.578445000 +0200
1
--- cciss_vol_status.c.orig	2017-03-10 22:14:51 UTC
2
+++ cciss_vol_status.c	2017-10-18 07:51:20.372056000 +0200
2
+++ cciss_vol_status.c
3
@@ -1098,7 +1098,7 @@
3
@@ -23,6 +23,8 @@
4
 #include <config.h>
5
 #endif
6
 
7
+#include <arpa/inet.h>
8
+
9
 #define VERSION_NUMBER PACKAGE_VERSION
10
 
11
 #include <stdio.h>
12
@@ -193,8 +195,10 @@ struct smartarray_id_t {
13
 #ifdef HAVE_SCSI_SG_H
14
 	{ MSA1000_ID, "MSA1000",	1, 0},
15
 #else
16
+#ifndef __FreeBSD__
17
 #warning Since <scsi/sg.h> is not around, MSA1000 support will not be compiled.
18
 #endif
19
+#endif
20
 	{ 0xFFFFFFFF, "Unknown Smart Array",	0, 1},
21
 };
22
 
23
@@ -613,8 +617,13 @@ char *progname = "cciss_vol_status";
24
 
25
 void usage()
26
 {
27
-	fprintf(stderr, "%s: usage: %s [-p] [-q] [-v] [-u] [-x] /dev/cciss/c*d0 /dev/sg*\n", progname, progname);
28
+#ifdef __FreeBSD__
29
+	fprintf(stderr, "%s: usage: %s [<options>] /dev/ciss*\n", progname, progname);
30
+#else
31
+	fprintf(stderr, "%s: usage: %s [<options>] /dev/cciss/* /dev/sg*\n", progname, progname);
32
+#endif
33
 	fprintf(stderr, " -p  --persnickety          Complain about device nodes which can't be opened.\n");
34
+	fprintf(stderr, " -q  --quiet                Be more quiet.\n");
35
 	fprintf(stderr, " -u  --try-unknown-devices  Allow interrogation of even unrecognized controllers\n");
36
 	fprintf(stderr, "                            (useful for brand new hardware.)\n");
37
 	fprintf(stderr, " -s  --smart                Report S.M.A.R.T. predictive failures. \n");
38
@@ -637,7 +646,7 @@ static void find_bus_target(struct ident
39
 	int big_map_support;
40
 	int drives_per_scsi_bus;
41
 
42
-	big_map_support = (id->controller_flags && (1<<7));
43
+	big_map_support = (id->controller_flags & (1<<7));
44
 	drives_per_scsi_bus = id->drives_per_scsi_bus;;
45
 
46
 	/* if no big drive map support, & zero devices per scsi bus */
47
@@ -683,7 +692,7 @@ static void format_phys_drive_location(c
48
 		copy_drive_field(model, device_data->drive_model, sizeof(device_data->drive_model));
49
 		copy_drive_field(serial_no, device_data->drive_serial_no, sizeof(device_data->drive_serial_no));
50
 		copy_drive_field(fw_rev, device_data->drive_fw_rev, sizeof(device_data->drive_fw_rev));
51
-		sprintf(tail, " connector %c%c box %d bay %d %40s %40s %8s",
52
+		sprintf(tail, " connector %c%c box %d bay %-2d %40s %40s %8s",
53
 			device_data->phys_connector[0],
54
 			device_data->phys_connector[1],
55
 			device_data->phys_box_on_bus,
56
@@ -1001,7 +1010,7 @@ static void show_disk_map(char *title, c
57
 	struct identify_physical_device device_data;
58
 	char location[300];
59
 
60
-	big_map_support = (id->controller_flags && (1<<7));
61
+	big_map_support = (id->controller_flags & (1<<7));
62
 	drives_per_scsi_bus = id->drives_per_scsi_bus;;
63
 
64
 	/* if no big drive map support, & zero devices per scsi bus */
65
@@ -1098,7 +1107,7 @@ static void print_volume_status(char *fi
4
 			break;
66
 			break;
5
 		case 1: sprintf(raid_level, "RAID 4");
67
 		case 1: sprintf(raid_level, "RAID 4");
6
 			break;
68
 			break;
Lines 9-11 Link Here
9
 			break;
71
 			break;
10
 		case 3: sprintf(raid_level, "RAID 5");
72
 		case 3: sprintf(raid_level, "RAID 5");
11
 			break;
73
 			break;
74
@@ -1204,7 +1213,7 @@ static void print_bus_status(char *file,
75
 	/* Eg. 6400 with internal card cage gives back bogus info */
76
 	/* for me for the serial number. */
77
 	strncpy(enclosure_sn, bus_param->chassis_sn, 40);
78
-	enclosure_sn[41] = '\0';
79
+	enclosure_sn[40] = '\0';
80
 	for (i = 40 - 1; i > 0; i--)
81
 		if (enclosure_sn[i] == ' ') {
82
 			enclosure_sn[i] = '\0';
83
@@ -2291,7 +2300,7 @@ static void check_one_nonvolatile_cache_
84
 		return;
85
 
86
 	printf("%35s: %hu MiB\n", "Total cache memory", cache_config->total_memory_size);
87
-	printf("%35s: %d% Read / %d% Write\n", "Cache Ratio", cache_config->percent_read_cache, cache_config->percent_write_cache);
88
+	printf("%35s: %d%% Read / %d%% Write\n", "Cache Ratio", cache_config->percent_read_cache, cache_config->percent_write_cache);
89
 	printf("%35s: %hu MiB\n", "Read cache memory", cache_config->mem_for_read_cache);
90
 	printf("%35s: %hu MiB\n", "Write cache memory", cache_config->mem_for_write_cache);
91
 	printf("%35s: %s\n", "Write cache enabled",
92
@@ -2357,6 +2366,7 @@ static void check_nonvolatile_cache_stat
93
 	}
94
 }
95
 
96
+#ifdef HAVE_SCSI_SG_H
97
 static int msa1000_status(char *file, int fd)
98
 {
99
 	int i, rc, numluns;
100
@@ -2378,6 +2388,7 @@ static int msa1000_status(char *file, in
101
 	close(fd);
102
 	return 0;
103
 }
104
+#endif
105
 
106
 static int cciss_device_type_is_correct(char *file, int fd)
107
 {
108
@@ -2477,7 +2488,7 @@ static void cciss_logical_drive_status(c
109
 
110
 static inline int bmic_supports_big_maps(struct identify_controller *id)
111
 {
112
-	return id->controller_flags && (1<<7);
113
+	return id->controller_flags & (1<<7);
114
 }
115
 
116
 static int bmic_next_disk_bits(uint8_t *bits, int bitmapsize, int disk)

Return to bug 246357