File tree Expand file tree Collapse file tree 3 files changed +26
-10
lines changed
Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ dd-after-help = ### Operands
114114 - noctty : do not assign a controlling tty.
115115 - nofollow : do not follow system links.
116116
117+ # Common strings
118+ dd-standard-input = 'standard input'
119+ dd-standard-output = 'standard output'
120+
117121# Error messages
118122dd-error-failed-to-open = failed to open { $path }
119123dd-error-write-error = write error
@@ -123,8 +127,7 @@ dd-error-cannot-skip-offset = '{ $file }': cannot skip to specified offset
123127dd-error-cannot-skip-invalid = '{ $file } ': cannot skip: Invalid argument
124128dd-error-cannot-seek-invalid = '{ $output } ': cannot seek: Invalid argument
125129dd-error-not-directory = setting flags for '{ $file } ': Not a directory
126- dd-error-failed-discard-cache-input = failed to discard cache for: 'standard input'
127- dd-error-failed-discard-cache-output = failed to discard cache for: 'standard output'
130+ dd-error-failed-discard-cache = failed to discard cache for: { $file }
128131
129132# Parse errors
130133dd-error-unrecognized-operand = Unrecognized operand '{ $operand } '
Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ dd-after-help = ### Opérandes
114114 - noctty : ne pas assigner un tty de contrôle.
115115 - nofollow : ne pas suivre les liens système.
116116
117+ # Common strings
118+ dd-standard-input = 'entrée standard'
119+ dd-standard-output = 'sortie standard'
120+
117121# Error messages
118122dd-error-failed-to-open = échec de l'ouverture de { $path }
119123dd-error-write-error = erreur d'écriture
@@ -123,8 +127,7 @@ dd-error-cannot-skip-offset = '{ $file }' : impossible d'ignorer jusqu'au décal
123127dd-error-cannot-skip-invalid = '{ $file } ' : impossible d'ignorer : Argument invalide
124128dd-error-cannot-seek-invalid = '{ $output } ' : impossible de rechercher : Argument invalide
125129dd-error-not-directory = définir les indicateurs pour '{ $file } ' : N'est pas un répertoire
126- dd-error-failed-discard-cache-input = échec de la suppression du cache pour : 'entrée standard'
127- dd-error-failed-discard-cache-output = échec de la suppression du cache pour : 'sortie standard'
130+ dd-error-failed-discard-cache = échec de la suppression du cache pour : { $file }
128131
129132# Parse errors
130133dd-error-unrecognized-operand = Opérande non reconnue '{ $operand } '
Original file line number Diff line number Diff line change @@ -467,10 +467,15 @@ impl Input<'_> {
467467 fn discard_cache ( & self , offset : libc:: off_t , len : libc:: off_t ) {
468468 #[ cfg( target_os = "linux" ) ]
469469 {
470+ let file = self
471+ . settings
472+ . infile
473+ . clone ( )
474+ . unwrap_or_else ( || translate ! ( "dd-standard-input" ) ) ;
470475 show_if_err ! (
471- self . src
472- . discard_cache ( offset , len )
473- . map_err_context ( || translate! ( "dd-error-failed-discard-cache-input" ) )
476+ self . src. discard_cache ( offset , len ) . map_err_context (
477+ || translate! ( "dd-error-failed-discard-cache" , "file" => file )
478+ )
474479 ) ;
475480 }
476481 #[ cfg( not( target_os = "linux" ) ) ]
@@ -909,10 +914,15 @@ impl<'a> Output<'a> {
909914 fn discard_cache ( & self , offset : libc:: off_t , len : libc:: off_t ) {
910915 #[ cfg( target_os = "linux" ) ]
911916 {
917+ let file = self
918+ . settings
919+ . outfile
920+ . clone ( )
921+ . unwrap_or_else ( || translate ! ( "dd-standard-output" ) ) ;
912922 show_if_err ! (
913- self . dst
914- . discard_cache ( offset , len )
915- . map_err_context ( || { translate! ( "dd-error-failed-discard-cache-output" ) } )
923+ self . dst. discard_cache ( offset , len ) . map_err_context (
924+ || translate! ( "dd-error-failed-discard-cache" , "file" => file )
925+ )
916926 ) ;
917927 }
918928 #[ cfg( not( target_os = "linux" ) ) ]
You can’t perform that action at this time.
0 commit comments