Skip to content

Commit

Permalink
feat: Change job output from appending to overwriting (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nativu5 authored Jun 16, 2024
1 parent 3e981e3 commit 4af06fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Craned/TaskManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ CraneErr TaskManager::SpawnProcessInInstance_(
process->batch_meta.parsed_error_file_pattern;

stdout_fd =
open(stdout_file_path.c_str(), O_RDWR | O_CREAT | O_APPEND, 0644);
open(stdout_file_path.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0644);
if (stdout_fd == -1) {
CRANE_ERROR("[Child Process] Error: open {}. {}", stdout_file_path,
strerror(errno));
Expand All @@ -697,7 +697,7 @@ CraneErr TaskManager::SpawnProcessInInstance_(
dup2(stdout_fd, 2);
} else {
stderr_fd =
open(stderr_file_path.c_str(), O_RDWR | O_CREAT | O_APPEND, 0644);
open(stderr_file_path.c_str(), O_RDWR | O_CREAT | O_TRUNC, 0644);
if (stderr_fd == -1) {
CRANE_ERROR("[Child Process] Error: open {}. {}", stderr_file_path,
strerror(errno));
Expand Down

0 comments on commit 4af06fd

Please sign in to comment.