summaryrefslogtreecommitdiff
path: root/src/posix-io.c
diff options
context:
space:
mode:
authorJinWang An <jinwang.an@samsung.com>2021-12-01 16:54:34 +0900
committerJinWang An <jinwang.an@samsung.com>2021-12-01 16:54:34 +0900
commit446ad01df66cb2f4dd51d97ff02be16d765847e1 (patch)
treefc37818847b146ba78134cb74234900b1614418e /src/posix-io.c
parent4db435874bc286631d5dc726f68ba5bb86a1bb89 (diff)
downloadgpgme-446ad01df66cb2f4dd51d97ff02be16d765847e1.tar.gz
gpgme-446ad01df66cb2f4dd51d97ff02be16d765847e1.tar.bz2
gpgme-446ad01df66cb2f4dd51d97ff02be16d765847e1.zip
Imported Upstream version 1.4.4upstream/1.4.4
Diffstat (limited to 'src/posix-io.c')
-rw-r--r--src/posix-io.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/posix-io.c b/src/posix-io.c
index ceb8831..c315539 100644
--- a/src/posix-io.c
+++ b/src/posix-io.c
@@ -340,10 +340,15 @@ int
_gpgme_io_waitpid (int pid, int hang, int *r_status, int *r_signal)
{
int status;
+ pid_t ret;
*r_status = 0;
*r_signal = 0;
- if (_gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG) == pid)
+ do
+ ret = _gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG);
+ while (ret == (pid_t)(-1) && errno == EINTR);
+
+ if (ret == pid)
{
if (WIFSIGNALED (status))
{
@@ -714,7 +719,11 @@ _gpgme_io_sendmsg (int fd, const struct msghdr *msg, int flags)
int
_gpgme_io_dup (int fd)
{
- int new_fd = dup (fd);
+ int new_fd;
+
+ do
+ new_fd = dup (fd);
+ while (new_fd == -1 && errno == EINTR);
TRACE1 (DEBUG_SYSIO, "_gpgme_io_dup", fd, "new fd==%i", new_fd);
@@ -744,7 +753,9 @@ _gpgme_io_connect (int fd, struct sockaddr *addr, int addrlen)
TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_connect", fd,
"addr=%p, addrlen=%i", addr, addrlen);
- res = ath_connect (fd, addr, addrlen);
+ do
+ res = ath_connect (fd, addr, addrlen);
+ while (res == -1 && errno == EINTR);
return TRACE_SYSRES (res);
}