← Commit list

d3a7e8800

Denys Vlasenko
Denys Vlasenko
2017-10-27
SUCCESS Duration: 142s

Subject

time: fix build for toolchains without O_CLOEXEC

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/time.c+5 -0
@@ -442,11 +442,16 @@ int time_main(int argc UNUSED_PARAM, char **argv)
output_format = posix_format;
output_fd = STDERR_FILENO;
if (opt & OPT_o) {
+#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);
}
run_command(argv, &res);