On Thu, Oct 19, 2017 at 12:05 AM, Eugene Rudoy <[email protected]> wrote:
> Kernel versions < 2.6.23 do not support/provide O_CLOEXEC symbol
> causing the time applet not to compile:
>
> time.c: In function 'time_main':
> time.c:445:28: error: 'O_CLOEXEC' undeclared (first use in this function)
> time.c:445:28: note: each undeclared identifier is reported only once for
> each function it appears in
This is not a kernel problem, it's toolchain.
I'm going with this:
+#ifndef O_CLOEXEC
+# define O_CLOEXEC 0
+#endif
output_fd = xopen(output_filename,
(opt & OPT_a) /* append? */
? (O_CREAT | O_WRONLY | O_CLOEXEC | O_APPEND)
: (O_CREAT | O_WRONLY | O_CLOEXEC | O_TRUNC)
);
+ if (!O_CLOEXEC)
+ close_on_exec_on(output_fd);
since it will not pessimize code for newer toolchains.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox