From 99402f41c63c7c833705d1b34ef65be5c35baf46 Mon Sep 17 00:00:00 2001 From: claudio Date: Tue, 16 Jan 2024 13:07:29 +0000 Subject: [PATCH] Use imsg_get_fd() and adjust cleanup code accordingly. OK nicm@ --- usr.bin/file/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/file/file.c b/usr.bin/file/file.c index 3183adb484d..9fb35dba3b6 100644 --- a/usr.bin/file/file.c +++ b/usr.bin/file/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.69 2019/11/30 14:01:45 mestre Exp $ */ +/* $OpenBSD: file.c,v 1.70 2024/01/16 13:07:29 claudio Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -418,12 +418,12 @@ child(int fd, pid_t parent, int argc, char **argv) inf.msg = msg; inf.path = argv[idx]; - inf.fd = imsg.fd; + inf.fd = imsg_get_fd(&imsg); test_file(&inf, width); - if (imsg.fd != -1) - close(imsg.fd); + if (inf.fd != -1) + close(inf.fd); imsg_free(&imsg); ack.idx = idx; -- 2.20.1