From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684600703; x=1687192703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=s43a3R9SdGHNS10p2/Ys9kq0kOggs2ItF/M3RwGmhhs=; b=NXf3wx2Mqu9lAs8pO9WQeJmrku9T9zsqle0zIxLAQIvmmlOEFWQtBhPqxJcS3RjLN6 H4NaJdxI9kUKEa1dSw+Pk9/XvWFpoKr0gltm2XGnuv1a9peRgtcqCzx+0vUvY4YkMGK6 lCRCPshwVA3FBbjHNhdOWJbq6IrAjXSzKek4oK0VdJRBUrX2kt3Ys1EaekPK6ZeQKQRl aCvfHlayps4vla1i0UPNuX3ATU8OQxrH33oc92CI5Q+sLYqmTSdypbBDX0mMxngejvvQ cZz5NHNpwgIPR9+cLMk7HVGdbpD+T2P/eRL+Cn+dSRy0E+ERwxCI/QkVDFMEtKN/SnY/ /UYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684600703; x=1687192703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s43a3R9SdGHNS10p2/Ys9kq0kOggs2ItF/M3RwGmhhs=; b=SHNWDy1iU7+H9d/HUha2vKP9L/xtPx7d7gSXBaxxPTFkPZVc7kqk0KPHTpuav7MtnF 2CwCMpJeYkrHPHH/8AI+82pVrixfYOp1oFAxK346TItGct6d+ep9q/Dk43YCiekrsVmR wO7gJq6lykZNvE44NC2C7eYbXlPzN2HXhJEVQnkpSKJdNzs3RET5uDGBky2yfZalRrfS EPDpt2Hc3zvoOrhga7h+YeAU9sbwRVKjSN9dRBJ/LD5C5DFu81TCrkyCutYQfhNW06F8 PRg6GPmqnm22ecTO5XWfWGADMpNwTaGcdwn2KFcdErJYoSZ8Sh5hlns7vvKPa+/LUIYW GRcg== X-Gm-Message-State: AC+VfDyVzWyI5AaYde+Y8h9znl1Br8UWWTvX2PeMZGbbUPeCNlk59SQV PDg6TSN8bqyCGJYPwc/lWi9M8t0oE7A= X-Google-Smtp-Source: ACHHUZ5Jvrhh14apXiY2q5ZzQwG+8ZRJFCO9YGVJ7AN+Dzp45K7HbyXfdXTV8nVPrnpfJQwaJhVx+w== X-Received: by 2002:a5d:5744:0:b0:306:2eab:fb8c with SMTP id q4-20020a5d5744000000b003062eabfb8cmr4453828wrw.42.1684600703392; Sat, 20 May 2023 09:38:23 -0700 (PDT) From: Alexey Gladkov To: make-initrd@lists.altlinux.org Date: Sat, 20 May 2023 18:37:47 +0200 Message-Id: <20230520163748.177260-2-gladkov.alexey@gmail.com> X-Mailer: git-send-email 2.33.8 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [make-initrd] [PATCH 2/3] ueventd: Rename fd_list to fd_handler_list X-BeenThere: make-initrd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: make-initrd@lists.altlinux.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 May 2023 16:38:26 -0000 Archived-At: List-Archive: Signed-off-by: Alexey Gladkov --- datasrc/ueventd/ueventd.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/datasrc/ueventd/ueventd.c b/datasrc/ueventd/ueventd.c index 9c20594f..2d510d62 100644 --- a/datasrc/ueventd/ueventd.c +++ b/datasrc/ueventd/ueventd.c @@ -47,7 +47,7 @@ struct fd_handler { fdhandler_t fd_handler; }; -struct fd_handler fd_list[FD_MAX]; +struct fd_handler fd_handler_list[FD_MAX]; enum { PIPE_READ, @@ -428,8 +428,8 @@ pid_t spawn_worker(int epollfd, struct watch *queue) rd_fatal("prctl(PR_SET_PDEATHSIG): %m"); for (int i = 0; i < FD_MAX; i++) { - if (fd_list[i].fd >= 0) - close(fd_list[i].fd); + if (fd_handler_list[i].fd >= 0) + close(fd_handler_list[i].fd); } close(epollfd); @@ -501,18 +501,18 @@ int main(int argc, char **argv) uevent_confdb = get_param_dir("uevent_confdb"); handler_file = argv[optind++]; - setup_inotify_fd(&fd_list[FD_INOTIFY]); - setup_signal_fd(&fd_list[FD_SIGNAL]); - setup_pipe_fd(&fd_list[FD_PIPE]); + setup_inotify_fd(&fd_handler_list[FD_INOTIFY]); + setup_signal_fd(&fd_handler_list[FD_SIGNAL]); + setup_pipe_fd(&fd_handler_list[FD_PIPE]); - epollfd = setup_epoll_fd(fd_list); + epollfd = setup_epoll_fd(fd_handler_list); - watch_pauses(fd_list[FD_INOTIFY].fd); + watch_pauses(fd_handler_list[FD_INOTIFY].fd); - if (watch_path(fd_list[FD_INOTIFY].fd, filter_dir, ".", EV_ROOT_MASK, F_ROOT_DIR) < 0) + if (watch_path(fd_handler_list[FD_INOTIFY].fd, filter_dir, ".", EV_ROOT_MASK, F_ROOT_DIR) < 0) exit(EXIT_FAILURE); - watch_queues(fd_list[FD_INOTIFY].fd); + watch_queues(fd_handler_list[FD_INOTIFY].fd); apply_pause(); while (1) { @@ -550,15 +550,15 @@ done: n = e->next; if (e->q_pid) kill(e->q_pid, SIGKILL); - inotify_rm_watch(fd_list[FD_INOTIFY].fd, e->q_watchfd); + inotify_rm_watch(fd_handler_list[FD_INOTIFY].fd, e->q_watchfd); free(e); } for (i = 0; i < FD_MAX; i++) { - if (fd_list[i].fd >= 0) { - if (epoll_ctl(epollfd, EPOLL_CTL_DEL, fd_list[i].fd, NULL) < 0) + if (fd_handler_list[i].fd >= 0) { + if (epoll_ctl(epollfd, EPOLL_CTL_DEL, fd_handler_list[i].fd, NULL) < 0) rd_err("epoll_ctl: %m"); - close(fd_list[i].fd); + close(fd_handler_list[i].fd); } } close(epollfd); -- 2.33.8