diff mbox series

[02/25] child: fix usage of gzFile and gzopen()

Message ID 20220209222610.438470-3-mcgrof@kernel.org (mailing list archive)
State New, archived
Headers show
Series dbench: fix compile warnings and update a bit | expand

Commit Message

Luis Chamberlain Feb. 9, 2022, 10:25 p.m. UTC
The code uses gzFile as a pointer, but it is not the
intended design. This works as a pointer works just
as well as the stupid file descriptor. Fix this usage
to shut up gcc compilation warnings and make proper use
of the API.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 child.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/child.c b/child.c
index 7abb238..04bc474 100644
--- a/child.c
+++ b/child.c
@@ -329,7 +329,7 @@  void child_run(struct child_struct *child0, const char *loadfile)
 	char **sparams, **params;
 	char *p;
 	const char *status;
-	gzFile *gzf;
+	gzFile gzf;
 	pid_t parent = getppid();
 	double targett;
 	struct child_struct *child;
@@ -348,7 +348,7 @@  void child_run(struct child_struct *child0, const char *loadfile)
 	}
 
 	gzf = gzopen(loadfile, "r");
-	if (gzf == NULL) {
+	if (!gzf) {
 		perror(loadfile);
 		exit(1);
 	}