comparison src/content.c @ 227:c48d7e881a21 noffle

[svn] fixed expiration of temp overview files, once again.
author mirkol
date Tue, 18 Dec 2001 15:24:49 +0000
parents ffb1848a39db
children 52f467c7213b
comparison
equal deleted inserted replaced
226:6622f409f5fb 227:c48d7e881a21
1 /* 1 /*
2 content.c 2 content.c
3 3
4 $Id: content.c 342 2001-12-09 12:31:57Z bears $ 4 $Id: content.c 357 2001-12-18 15:24:49Z mirkol $
5 */ 5 */
6 6
7 #if HAVE_CONFIG_H 7 #if HAVE_CONFIG_H
8 #include <config.h> 8 #include <config.h>
9 #endif 9 #endif
347 } 347 }
348 if ( ! d->d_name ) 348 if ( ! d->d_name )
349 return FALSE; 349 return FALSE;
350 if ( d->d_name[0] == '.' ) 350 if ( d->d_name[0] == '.' )
351 { 351 {
352 Str tmpfname; 352 Str tmpfname;
353 353
354 /* 354 /*
355 * If it is '.' or '..', skip. 355 * If it is '.' or '..', skip.
356 * If it starts '.#', treat as a temporary file that didn't 356 * If it starts '.#', treat as a temporary file that didn't
357 * get deleted for some reason and flag an error and delete it. 357 * get deleted for some reason and flag an error and delete it.
361 case '\0': 361 case '\0':
362 case '.': 362 case '.':
363 break; 363 break;
364 364
365 case '#': 365 case '#':
366 snprintf( tmpfname, MAXCHAR, "%s/overview/.#%d.%s", 366 snprintf( tmpfname, MAXCHAR, "%s/overview/%s",
367 Cfg_spoolDir(), (int) getpid(), d->d_name ); 367 Cfg_spoolDir(), d->d_name );
368 Log_err( "Bad temporary file %s - please delete", 368 Log_err( "Bad temporary file %s - deleting.",
369 tmpfname ); 369 tmpfname );
370 if ( unlink( tmpfname ) < 0 ) 370 if ( unlink( tmpfname ) < 0 )
371 Log_err( "Unlink of %s failed: %s", 371 Log_err( "Unlink of %s failed: %s",
372 tmpfname, strerror(errno) ); 372 tmpfname, strerror(errno) );
373 break; 373 break;
374 374