@@ -229,14 +229,14 @@ int reset_attrib(const char *filepath)
229
229
#define ROBUST_MAXTRY 10
230
230
#define ROBUST_WAIT 100
231
231
232
- FILE * robust_fopen (const char * filename , const char * mode )
232
+ FILE * robust_fopen (const char * filepath , const char * mode )
233
233
{
234
234
FILE * ret ;
235
235
int i ;
236
236
for (i = 0 ; i < ROBUST_MAXTRY ; i ++ ) {
237
237
if (i ) Sleep (ROBUST_WAIT );
238
- reset_attrib (filename );
239
- ret = fopen (filename , mode );
238
+ reset_attrib (filepath );
239
+ ret = fopen (filepath , mode );
240
240
if (ret || errno == ENOENT ) break ;
241
241
}
242
242
return ret ;
@@ -252,20 +252,7 @@ int safe_fclose(FILE **fp)
252
252
return ret ;
253
253
}
254
254
255
- int robust_unlink (const char * filename )
256
- {
257
- int ret ;
258
- int i ;
259
- for (i = 0 ; i < ROBUST_MAXTRY ; i ++ ) {
260
- if (i ) Sleep (ROBUST_WAIT );
261
- reset_attrib (filename );
262
- ret = _unlink (filename );
263
- if (ret == 0 || errno == ENOENT ) break ;
264
- }
265
- return ret ;
266
- }
267
-
268
- int batch_delete (const char * filepath [], int n )
255
+ int robust_delete (const char * filepath [], int n )
269
256
{
270
257
int i , j ;
271
258
for (i = 0 ; i < ROBUST_MAXTRY ; i ++ ) {
@@ -279,3 +266,8 @@ int batch_delete(const char *filepath[], int n)
279
266
}
280
267
return 0 ;
281
268
}
269
+
270
+ int robust_delete1 (const char * filepath )
271
+ {
272
+ return robust_delete (& filepath , 1 );
273
+ }
0 commit comments