From: Mike Gilbert Date: Tue, 9 Dec 2025 18:26:40 +0000 (-0500) Subject: ucm: clean up data types X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=8b4bc8af5f478715333612a3c3c1b92c24d3e45b;p=alsa-lib.git ucm: clean up data types int should be used for file descriptors. sysconf returns long. waitpid returns pid_t. Closes: https://github.com/alsa-project/alsa-lib/pull/487 Signed-off-by: Mike Gilbert Signed-off-by: Jaroslav Kysela --- diff --git a/src/ucm/ucm_exec.c b/src/ucm/ucm_exec.c index c16a4cfd..fdd88798 100644 --- a/src/ucm/ucm_exec.c +++ b/src/ucm/ucm_exec.c @@ -183,7 +183,7 @@ static int parse_args(char ***argv, int argc, const char *cmd) */ int uc_mgr_exec(const char *prog) { - pid_t p, f; + pid_t p; int err = 0, status; char bin[PATH_MAX]; struct sigaction sa; @@ -239,7 +239,7 @@ int uc_mgr_exec(const char *prog) } if (p == 0) { - f = open("/dev/null", O_RDWR); + int f = open("/dev/null", O_RDWR); if (f == -1) { snd_error(UCM, "pid %d cannot open /dev/null for redirect %s -- %s", getpid(), prog, strerror(errno)); @@ -261,7 +261,7 @@ int uc_mgr_exec(const char *prog) closefrom(3); #else { - pid_t maxfd = sysconf(_SC_OPEN_MAX); + long maxfd = sysconf(_SC_OPEN_MAX); for (f = 3; f < maxfd; f++) close(f); } @@ -287,8 +287,8 @@ int uc_mgr_exec(const char *prog) setpgid(p, p); while (1) { - f = waitpid(p, &status, 0); - if (f == -1) { + pid_t r = waitpid(p, &status, 0); + if (r == -1) { if (errno == EAGAIN) continue; err = -errno;