]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
io-util: rename 'nfds' -> 'n_fds'
authorJelle van der Waa <jvanderwaa@redhat.com>
Mon, 2 Jun 2025 15:42:08 +0000 (17:42 +0200)
committerJelle van der Waa <jvanderwaa@redhat.com>
Mon, 2 Jun 2025 16:05:45 +0000 (18:05 +0200)
src/basic/io-util.c
src/basic/io-util.h
src/basic/terminal-util.c

index 69c275ae179f2e7923332eda1ecb79a296f01fbd..82fad1303f95cc3f3d90daffd350c39307e7dd24 100644 (file)
@@ -188,10 +188,10 @@ int pipe_eof(int fd) {
         return !!(r & POLLHUP);
 }
 
-int ppoll_usec_full(struct pollfd *fds, size_t nfds, usec_t timeout, const sigset_t *ss) {
+int ppoll_usec_full(struct pollfd *fds, size_t n_fds, usec_t timeout, const sigset_t *ss) {
         int r;
 
-        assert(fds || nfds == 0);
+        assert(fds || n_fds == 0);
 
         /* This is a wrapper around ppoll() that does primarily two things:
          *
@@ -208,16 +208,16 @@ int ppoll_usec_full(struct pollfd *fds, size_t nfds, usec_t timeout, const sigse
          *  to handle signals, such as signalfd() or signal handlers. ⚠️ ⚠️ ⚠️
          */
 
-        if (nfds == 0 && timeout == 0)
+        if (n_fds == 0 && timeout == 0)
                 return 0;
 
-        r = ppoll(fds, nfds, timeout == USEC_INFINITY ? NULL : TIMESPEC_STORE(timeout), ss);
+        r = ppoll(fds, n_fds, timeout == USEC_INFINITY ? NULL : TIMESPEC_STORE(timeout), ss);
         if (r < 0)
                 return -errno;
         if (r == 0)
                 return 0;
 
-        for (size_t i = 0, n = r; i < nfds && n > 0; i++) {
+        for (size_t i = 0, n = r; i < n_fds && n > 0; i++) {
                 if (fds[i].revents == 0)
                         continue;
                 if (fds[i].revents & POLLNVAL)
index f560b706b443bedfe33c82988dbc0bf682bdc066..237a9ff77f785370c6e077dd9e827996115bdeef 100644 (file)
@@ -15,9 +15,9 @@ static inline int loop_write(int fd, const void *buf, size_t nbytes) {
 
 int pipe_eof(int fd);
 
-int ppoll_usec_full(struct pollfd *fds, size_t nfds, usec_t timeout, const sigset_t *ss) _nonnull_if_nonzero_(1, 2);
-_nonnull_if_nonzero_(1, 2) static inline int ppoll_usec(struct pollfd *fds, size_t nfds, usec_t timeout) {
-        return ppoll_usec_full(fds, nfds, timeout, NULL);
+int ppoll_usec_full(struct pollfd *fds, size_t n_fds, usec_t timeout, const sigset_t *ss) _nonnull_if_nonzero_(1, 2);
+_nonnull_if_nonzero_(1, 2) static inline int ppoll_usec(struct pollfd *fds, size_t n_fds, usec_t timeout) {
+        return ppoll_usec_full(fds, n_fds, timeout, NULL);
 }
 
 int fd_wait_for_event(int fd, int event, usec_t timeout);
index b2a1c5c61567d4296930f99dd05de939f03e118c..5f7b6703891bed59b9cd7e39ca6293526d1ebe1a 100644 (file)
@@ -735,7 +735,7 @@ int acquire_terminal(
                                                 .fd = notify,
                                                 .events = POLLIN,
                                         },
-                                        /* n_pollfds = */ 1,
+                                        /* n_fds = */ 1,
                                         left,
                                         &poll_ss);
                         if (r < 0)