@@ -168,8 +168,8 @@ static int write_entry(struct cache_entry *ce,
168
168
ret = symlink (new , path );
169
169
free (new );
170
170
if (ret )
171
- return error ("unable to create symlink %s (%s) " ,
172
- path , strerror ( errno ) );
171
+ return error_errno ("unable to create symlink %s" ,
172
+ path );
173
173
break ;
174
174
}
175
175
@@ -186,8 +186,7 @@ static int write_entry(struct cache_entry *ce,
186
186
fd = open_output_fd (path , ce , to_tempfile );
187
187
if (fd < 0 ) {
188
188
free (new );
189
- return error ("unable to create file %s (%s)" ,
190
- path , strerror (errno ));
189
+ return error_errno ("unable to create file %s" , path );
191
190
}
192
191
193
192
wrote = write_in_full (fd , new , size );
@@ -284,8 +283,7 @@ int checkout_entry(struct cache_entry *ce,
284
283
return error ("%s is a directory" , path .buf );
285
284
remove_subtree (& path );
286
285
} else if (unlink (path .buf ))
287
- return error ("unable to unlink old '%s' (%s)" ,
288
- path .buf , strerror (errno ));
286
+ return error_errno ("unable to unlink old '%s'" , path .buf );
289
287
} else if (state -> not_new )
290
288
return 0 ;
291
289
0 commit comments