diff options
author | Eric Wong <e@80x24.org> | 2021-11-22 18:16:32 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-11-22 21:36:50 +0000 |
commit | 74f027ca317067f7ae7289b15465d6a49078f65c (patch) | |
tree | b3f83f932178fd7f588481d4f4479a0ce93b39d8 /lib/PublicInbox | |
parent | eee1eb1ed3bbf3264676954bb879ed67376169b6 (diff) | |
download | public-inbox-74f027ca317067f7ae7289b15465d6a49078f65c.tar.gz |
This is future-proofing in case we build against Xapian directly in the future, which would require a C++ compiler.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/Spawn.pm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm index 6ca1ca2a..e0a51c21 100644 --- a/lib/PublicInbox/Spawn.pm +++ b/lib/PublicInbox/Spawn.pm @@ -165,14 +165,14 @@ int pi_fork_exec(SV *redirref, SV *file, SV *cmdref, SV *envref, SV *rlimref, return (int)pid; } -static int sleep_wait(unsigned *try, int err) +static int sleep_wait(unsigned *tries, int err) { const struct timespec req = { 0, 100000000 }; /* 100ms */ switch (err) { case ENOBUFS: case ENOMEM: case ETOOMANYREFS: - if (++*try < 50) { + if (++*tries < 50) { fprintf(stderr, "sleeping on sendmsg: %s (#%u)\n", - strerror(err), *try); + strerror(err), *tries); nanosleep(&req, NULL); return 1; } @@ -199,7 +199,7 @@ SV *send_cmd4(PerlIO *s, SV *svfds, SV *data, int flags) AV *fds = (AV *)SvRV(svfds); I32 i, nfds = av_len(fds) + 1; int *fdp; - unsigned try = 0; + unsigned tries = 0; if (SvOK(data)) { iov.iov_base = SvPV(data, dlen); @@ -229,7 +229,7 @@ SV *send_cmd4(PerlIO *s, SV *svfds, SV *data, int flags) } do { sent = sendmsg(PerlIO_fileno(s), &msg, flags); - } while (sent < 0 && sleep_wait(&try, errno)); + } while (sent < 0 && sleep_wait(&tries, errno)); return sent >= 0 ? newSViv(sent) : &PL_sv_undef; } |