diff --git a/rust/src/zstd_cli.rs b/rust/src/zstd_cli.rs index 291a046ec..db33cb801 100644 --- a/rust/src/zstd_cli.rs +++ b/rust/src/zstd_cli.rs @@ -157,6 +157,7 @@ unsafe extern "C" { fn FIO_setContentSize(prefs: *mut FIO_prefs_t, value: c_int); fn FIO_setAsyncIOFlag(prefs: *mut FIO_prefs_t, value: c_int); fn FIO_setPassThroughFlag(prefs: *mut FIO_prefs_t, value: c_int); + fn FIO_setPatchFromMode(prefs: *mut FIO_prefs_t, value: c_int); fn FIO_setMMapDict(prefs: *mut FIO_prefs_t, value: c_int); fn FIO_setNbFilesTotal(ctx: *mut FIO_ctx_t, value: c_int); fn FIO_setHasStdinInput(ctx: *mut FIO_ctx_t, value: c_int); @@ -1240,6 +1241,10 @@ unsafe fn apply_preferences(cli: &Cli, prefs: *mut FIO_prefs_t, ctx: *mut FIO_ct if let Some(value) = cli.pass_through { FIO_setPassThroughFlag(prefs, value); } + /* `FIO_createPreferences()` leaves this field unspecified. The Rust + * frontend does not yet parse --patch-from, so explicitly keep the + * C file-I/O backend in ordinary dictionary mode. */ + FIO_setPatchFromMode(prefs, 0); FIO_setContentSize(prefs, cli.content_size); if let Some(value) = cli.dict_id { FIO_setDictIDFlag(prefs, value);