Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15625 > unrolled thread
| Started by | "H.Merijn Brand" <h.m.brand@xs4all.nl> |
|---|---|
| First post | 2019-11-22 16:04 +0100 |
| Last post | 2019-11-22 16:04 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
5.0.11 is missing #ifdefs on CLOEXEC "H.Merijn Brand" <h.m.brand@xs4all.nl> - 2019-11-22 16:04 +0100
| From | "H.Merijn Brand" <h.m.brand@xs4all.nl> |
|---|---|
| Date | 2019-11-22 16:04 +0100 |
| Subject | 5.0.11 is missing #ifdefs on CLOEXEC |
| Message-ID | <mailman.2336.1574436371.13325.bug-bash@gnu.org> |
[Multipart message — attachments visible in raw view] — view raw
HP-UX 11.23/ia64 using GNU gcc-4.6.1 does not know about O_CLOEXEC
--8<---
--- examples/loadables/fdflags.c.org 2019-11-22 16:03:07 +0000
+++ examples/loadables/fdflags.c 2019-11-22 16:00:54 +0000
@@ -113,8 +113,10 @@ getflags(int fd, int p)
return -1;
}
+#ifdef O_CLOEXEC
if (c)
f |= O_CLOEXEC;
+#endif
return f & getallflags();
}
@@ -199,16 +201,20 @@ setone(int fd, char *v, int verbose)
parseflags(v, &pos, &neg);
cloexec = -1;
+#ifdef O_CLOEXEC
if ((pos & O_CLOEXEC) && (f & O_CLOEXEC) == 0)
cloexec = FD_CLOEXEC;
if ((neg & O_CLOEXEC) && (f & O_CLOEXEC))
cloexec = 0;
+#endif
if (cloexec != -1 && fcntl(fd, F_SETFD, cloexec) == -1)
builtin_error("can't set status for fd %d: %s", fd, strerror(errno));
+#ifdef O_CLOEXEC
pos &= ~O_CLOEXEC;
neg &= ~O_CLOEXEC;
f &= ~O_CLOEXEC;
+#endif
n = f;
n |= pos;
-->8---
--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.31 porting perl5 on HP-UX, AIX, and Linux
https://useplaintext.email https://tux.nl http://www.test-smoke.org
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Back to top | Article view | gnu.bash.bug
csiph-web