From b6b968d1c8fbba79b33d63874b551225e663435e Mon Sep 17 00:00:00 2001
From: "mark.yang" <mark.yang@lge.com>
Date: Wed, 2 Apr 2025 16:59:00 +0900
Subject: [PATCH] fix build with gcc-15 -Wincompatible-pointer-types error

See more details: http://errors.yoctoproject.org/Errors/Details/850314
utils/uevent_reader.c:33:24: error: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types]
   33 |         signal(SIGINT, exit_handler);
      |                        ^~~~~~~~~~~~
      |                        |
      |                        void (*)(void)
In file included from utils/uevent_reader.c:4:
TOPDIR/tmp/work/core2-64-oe-linux/pm-qa/0.5.2/recipe-sysroot/usr/include/signal.h:88:57: note: expected '__sighandler_t' {aka 'void (*)(int)'} but argument is of type 'void (*)(void)'
   88 | extern __sighandler_t signal (int __sig, __sighandler_t __handler)
      |                                          ~~~~~~~~~~~~~~~^~~~~~~~~
utils/uevent_reader.c:15:6: note: 'exit_handler' declared here
   15 | void exit_handler()
      |      ^~~~~~~~~~~~
TOPDIR/tmp/work/core2-64-oe-linux/pm-qa/0.5.2/recipe-sysroot/usr/include/signal.h:72:16: note: '__sighandler_t' declared here
   72 | typedef void (*__sighandler_t) (int);
      |                ^~~~~~~~~~~~~~

* Set the parameter of exit_handler() to int.
  Changed to use exit_handler(0).
  The parameter is not used inside exit_handler() anyway.

Upstream-Status: Inactive-Upstream [lastrelease: 6 years ago]
Signed-off-by: mark.yang <mark.yang@lge.com>
---
 utils/uevent_reader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/utils/uevent_reader.c b/utils/uevent_reader.c
index afbb426..75d445c 100644
--- a/utils/uevent_reader.c
+++ b/utils/uevent_reader.c
@@ -12,7 +12,7 @@
 
 FILE *fp;
 
-void exit_handler()
+void exit_handler(int sig)
 {
 	fprintf(stdout, "exiting from uevent reader...\n");
 	fclose(fp);
@@ -42,20 +42,20 @@ int main(int argc, char *argv[])
 	pfd.fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
 	if (pfd.fd == -1) {
 		perror("error: socket()");
-		exit_handler();
+		exit_handler(0);
 	}
 
 	if (bind(pfd.fd, (struct sockaddr *) &nls,
 				sizeof(struct sockaddr_nl))) {
 		perror("error : bind()");
-		exit_handler();
+		exit_handler(0);
 	}
 
 	while (-1 != poll(&pfd, 1, -1)) {
 		int i, len = recv(pfd.fd, buf, sizeof(buf), MSG_DONTWAIT);
 		if (len == -1) {
 			perror("error : recv()");
-			exit_handler();
+			exit_handler(0);
 		}
 
 		i = 0;
