Skip to content

Commit 21344df

Browse files
committed
exec: Don't flush if the user says no to -ok
1 parent c4676b3 commit 21344df

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

exec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,6 @@ static void bfs_exec_closewd(struct bfs_exec *execbuf, const struct BFTW *ftwbuf
325325

326326
/** Actually spawn the process. */
327327
static int bfs_exec_spawn(const struct bfs_exec *execbuf) {
328-
// Flush the context state for consistency with the external process
329-
bfs_ctx_flush(execbuf->ctx);
330-
331328
if (execbuf->flags & BFS_EXEC_CONFIRM) {
332329
for (size_t i = 0; i < execbuf->argc; ++i) {
333330
fprintf(stderr, "%s ", execbuf->argv[i]);
@@ -340,6 +337,9 @@ static int bfs_exec_spawn(const struct bfs_exec *execbuf) {
340337
}
341338
}
342339

340+
// Flush cached state for consistency with the external process
341+
bfs_ctx_flush(execbuf->ctx);
342+
343343
if (execbuf->flags & BFS_EXEC_MULTI) {
344344
bfs_exec_debug(execbuf, "Executing '%s' ... [%zu arguments] (size %zu)\n",
345345
execbuf->argv[0], execbuf->argc - 1, execbuf->arg_size);

0 commit comments

Comments
 (0)