diff --git a/daemon/x52d_client.c b/daemon/x52d_client.c index f536469..5ad3998 100644 --- a/daemon/x52d_client.c +++ b/daemon/x52d_client.c @@ -119,12 +119,11 @@ int x52d_client_poll(int client_fd[X52D_MAX_CLIENTS], struct pollfd pfd[MAX_CONN PINELOG_TRACE("Polling %d file descriptors", pfd_count); -retry_poll: - rc = poll(pfd, pfd_count, -1); + do { + rc = poll(pfd, pfd_count, -1); + } while (rc < 0 && errno == EINTR); + if (rc < 0) { - if (errno == EINTR) { - goto retry_poll; - } PINELOG_ERROR(_("Error %d when polling %d descriptors: %s"), errno, pfd_count, strerror(errno)); } else if (rc == 0) { diff --git a/daemon/x52d_notify.c b/daemon/x52d_notify.c index 564e9b9..4ddaf95 100644 --- a/daemon/x52d_notify.c +++ b/daemon/x52d_notify.c @@ -73,45 +73,32 @@ static void * x52_notify_thr(void * param) int rc; for (;;) { -read_pipe_size: - rc = read(notify_pipe[0], &bufsiz, sizeof(bufsiz)); - if (rc < 0) { - if (errno == EINTR) { - goto read_pipe_size; - } else { - PINELOG_ERROR(_("Error %d reading from pipe: %s"), - errno, strerror(errno)); - } - } - + do { + rc = read(notify_pipe[0], &bufsiz, sizeof(bufsiz)); + } while (rc < 0 && errno == EINTR); if (rc < 0) { + PINELOG_ERROR(_("Error %d reading from pipe: %s"), + errno, strerror(errno)); // Error condition, try again continue; } -read_pipe_data: - rc = read(notify_pipe[0], buffer, bufsiz); - if (rc < 0) { - if (errno == EINTR) { - goto read_pipe_data; - } else { - PINELOG_ERROR(_("Error %d reading from pipe: %s"), - errno, strerror(errno)); - } - } - + do { + rc = read(notify_pipe[0], buffer, bufsiz); + } while (rc < 0 && errno == EINTR); if (rc < 0) { + PINELOG_ERROR(_("Error %d reading from pipe: %s"), + errno, strerror(errno)); + // Error condition, try again continue; } for (int i = 0; i < X52D_MAX_CLIENTS; i++) { // Broadcast to every connected client if (client_fd[i] != INVALID_CLIENT) { -write_client_notification: - rc = write(client_fd[i], buffer, bufsiz); - if (rc < 0 && errno == EINTR) { - goto write_client_notification; - } + do { + rc = write(client_fd[i], buffer, bufsiz); + } while (rc < 0 && errno == EINTR); } } } diff --git a/po/libx52.pot b/po/libx52.pot index d4e4011..1e5f42f 100644 --- a/po/libx52.pot +++ b/po/libx52.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: libx52 0.3.2\n" "Report-Msgid-Bugs-To: https://github.com/nirenjan/libx52/issues\n" -"POT-Creation-Date: 2026-03-09 00:47-0700\n" +"POT-Creation-Date: 2026-03-12 08:31-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -613,12 +613,12 @@ msgstr "" msgid "Error when polling socket: FD %d, error %d, len %lu" msgstr "" -#: daemon/x52d_client.c:128 +#: daemon/x52d_client.c:127 #, c-format msgid "Error %d when polling %d descriptors: %s" msgstr "" -#: daemon/x52d_client.c:131 +#: daemon/x52d_client.c:130 msgid "Timed out when polling" msgstr "" @@ -916,27 +916,27 @@ msgstr "" msgid "Error setting up notification socket" msgstr "" -#: daemon/x52d_notify.c:82 daemon/x52d_notify.c:98 +#: daemon/x52d_notify.c:80 daemon/x52d_notify.c:90 #, c-format msgid "Error %d reading from pipe: %s" msgstr "" -#: daemon/x52d_notify.c:140 +#: daemon/x52d_notify.c:127 #, c-format msgid "Error %d writing notification pipe: %s" msgstr "" -#: daemon/x52d_notify.c:185 +#: daemon/x52d_notify.c:172 #, c-format msgid "Error %d creating notification pipe: %s" msgstr "" -#: daemon/x52d_notify.c:194 +#: daemon/x52d_notify.c:181 #, c-format msgid "Error %d initializing notify thread: %s" msgstr "" -#: daemon/x52d_notify.c:200 +#: daemon/x52d_notify.c:187 #, c-format msgid "Error %d initializing notify listener: %s" msgstr "" diff --git a/po/xx_PL.po b/po/xx_PL.po index deceb1b..bc6ee8a 100644 --- a/po/xx_PL.po +++ b/po/xx_PL.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: libx52 0.2.3\n" "Report-Msgid-Bugs-To: https://github.com/nirenjan/libx52/issues\n" -"POT-Creation-Date: 2026-03-09 00:47-0700\n" +"POT-Creation-Date: 2026-03-12 08:31-0700\n" "PO-Revision-Date: 2023-01-04 08:40-0800\n" "Last-Translator: Nirenjan Krishnan \n" "Language-Team: Dummy Language for testing i18n\n" @@ -662,12 +662,12 @@ msgstr "Erroray arkingmay ientclay fday %d asay onblockingnay: %s" msgid "Error when polling socket: FD %d, error %d, len %lu" msgstr "Erroray enwhay ollingpay ocketsay: FDay %d, erroray %d, enlay %lu" -#: daemon/x52d_client.c:128 +#: daemon/x52d_client.c:127 #, c-format msgid "Error %d when polling %d descriptors: %s" msgstr "Erroray %d enwhay ollingpay %d escriptorsday: %s" -#: daemon/x52d_client.c:131 +#: daemon/x52d_client.c:130 msgid "Timed out when polling" msgstr "Imedtay outay enwhay ollingpay" @@ -969,27 +969,27 @@ msgstr "Erroray isteninglay onay otificationnay ocketsay: %s" msgid "Error setting up notification socket" msgstr "Erroray ettingsay upay otificationnay ocketsay: %s" -#: daemon/x52d_notify.c:82 daemon/x52d_notify.c:98 +#: daemon/x52d_notify.c:80 daemon/x52d_notify.c:90 #, c-format msgid "Error %d reading from pipe: %s" msgstr "Erroray eadingray omfray ipepay %d: %s" -#: daemon/x52d_notify.c:140 +#: daemon/x52d_notify.c:127 #, c-format msgid "Error %d writing notification pipe: %s" msgstr "Erroray %d itingwray otificationnay ipepay: %s" -#: daemon/x52d_notify.c:185 +#: daemon/x52d_notify.c:172 #, c-format msgid "Error %d creating notification pipe: %s" msgstr "Erroray %d eatingcray otificationnay ipepay: %s" -#: daemon/x52d_notify.c:194 +#: daemon/x52d_notify.c:181 #, c-format msgid "Error %d initializing notify thread: %s" msgstr "Erroray %d initializingay otifynay eadthray: %s" -#: daemon/x52d_notify.c:200 +#: daemon/x52d_notify.c:187 #, c-format msgid "Error %d initializing notify listener: %s" msgstr "Erroray %d initializingay otifynay istenerlay: %s"