@@ -351,8 +351,7 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
351
351
error ("There were errors while writing %s (%s)" ,
352
352
path , strerror (io .io .wrerror ));
353
353
if (io .io .output && fclose (io .io .output ))
354
- io .io .wrerror = error ("Failed to flush %s: %s" ,
355
- path , strerror (errno ));
354
+ io .io .wrerror = error_errno ("Failed to flush %s" , path );
356
355
357
356
if (hunk_no < 0 ) {
358
357
if (output )
@@ -614,20 +613,17 @@ static int merge(const struct rerere_id *id, const char *path)
614
613
* Mark that "postimage" was used to help gc.
615
614
*/
616
615
if (utime (rerere_path (id , "postimage" ), NULL ) < 0 )
617
- warning ("failed utime() on %s: %s" ,
618
- rerere_path (id , "postimage" ),
619
- strerror (errno ));
616
+ warning_errno ("failed utime() on %s" ,
617
+ rerere_path (id , "postimage" ));
620
618
621
619
/* Update "path" with the resolution */
622
620
f = fopen (path , "w" );
623
621
if (!f )
624
- return error ("Could not open %s: %s" , path ,
625
- strerror (errno ));
622
+ return error_errno ("Could not open %s" , path );
626
623
if (fwrite (result .ptr , result .size , 1 , f ) != 1 )
627
- error ("Could not write %s: %s " , path , strerror ( errno ) );
624
+ error_errno ("Could not write %s" , path );
628
625
if (fclose (f ))
629
- return error ("Writing %s failed: %s" , path ,
630
- strerror (errno ));
626
+ return error_errno ("Writing %s failed" , path );
631
627
632
628
out :
633
629
free (cur .ptr );
@@ -842,7 +838,7 @@ static int rerere_forget_one_path(const char *path, struct string_list *rr)
842
838
if (unlink (filename ))
843
839
return (errno == ENOENT
844
840
? error ("no remembered resolution for %s" , path )
845
- : error ("cannot unlink %s: %s " , filename , strerror ( errno ) ));
841
+ : error_errno ("cannot unlink %s" , filename ));
846
842
847
843
/*
848
844
* Update the preimage so that the user can resolve the
0 commit comments