Skip to contentSkip to conversation

master - man-generator: fix compiler warnings

PATCH David Teigland 2 participants 2 messages Feb 14, 2017 – Feb 15, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1236e0ed293d13bff1205dbd2ac31877278b7a90
Commit:        1236e0ed293d13bff1205dbd2ac31877278b7a90
Parent:        1dddb068c90d553957dd8668b76c3eb9734b2e95
Author:        David Teigland <[email protected]>
AuthorDate:    Tue Feb 14 10:28:52 2017 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Feb 14 10:28:52 2017 -0600

man-generator: fix compiler warnings

---
 tools/command.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
tools/command.c +3 -4
index b655abe..aa33d5c 100644
@@ -2181,7 +2181,7 @@ void print_man_usage(char *lvmname, struct command *cmd)
 void print_man_usage_common(struct command *cmd)
 {
 	struct command_name *cname;
-	int i, sep, ro, rp, oo, op, opt_enum;
+	int i, sep, rp, oo, op, opt_enum;
 
 	if (!(cname = find_command_name(cmd->name)))
 		return;
@@ -2569,7 +2569,7 @@ static void include_description_file(char *name, char *des_file)
 	if (fd < 0)
 		return;
 
-	read(fd, buf, sizeof(buf));
+	(void)read(fd, buf, sizeof(buf));
 
 	buf[MAX_MAN_DESC-1] = '\0';
 
@@ -2584,8 +2584,7 @@ void print_man(char *name, char *des_file, int include_primary, int include_seco
 	struct command_name *cname;
 	struct command *cmd, *prev_cmd = NULL;
 	char *lvmname = name;
-	const char *desc;
-	int i, j, ro, rp, oo, op;
+	int i;
 
 	if (!strncmp(name, "lvm-", 4))
 		name += 4;
#1 lore raw

Dne 14.2.2017 v 17:29 David Teigland napsal(a):

Quoted 28 lines
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1236e0ed293d13bff1205dbd2ac31877278b7a90
Commit:        1236e0ed293d13bff1205dbd2ac31877278b7a90
Parent:        1dddb068c90d553957dd8668b76c3eb9734b2e95
Author:        David Teigland <[email protected]>
AuthorDate:    Tue Feb 14 10:28:52 2017 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Feb 14 10:28:52 2017 -0600

man-generator: fix compiler warnings

---
 tools/command.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
tools/command.c +1 -1
index b655abe..aa33d5c 100644
@@ -2181,7 +2181,7 @@ void print_man_usage(char *lvmname, struct command *cmd)
 void print_man_usage_common(struct command *cmd)
 {
 	struct command_name *cname;
-	int i, sep, ro, rp, oo, op, opt_enum;
+	int i, sep, rp, oo, op, opt_enum;
 
 	if (!(cname = find_command_name(cmd->name)))
 		return;

tools/command.c static void include_description_file(char *name, char *des_file) · line 2572

Quoted 5 lines
tools/command.c +1 -1
@@ -2569,7 +2569,7 @@ static void include_description_file(char *name, char *des_file)
 	if (fd < 0)
 		return;
 
-	read(fd, buf, sizeof(buf));
+	(void)read(fd, buf, sizeof(buf));

I'd say this is not the best approach how to handle any read failure.

Z.