ports/sysutils/radmind/files/patch-lapply.c
Sofian Brabez 8f100ec53f - Update PORTREVISION to 2012032001
- Add IGNORE_TIMESTAMPS OPTIONS
- Install sample configuration file

PR:		ports/166587
Submitted by:	Michael Graziano <mikeg at bsd-box.net>
2012-04-20 22:14:34 +00:00

52 lines
1.4 KiB
C

--- ./lapply.c.orig 2010-12-12 22:42:49.000000000 -0500
+++ ./lapply.c 2012-03-20 14:37:54.000000000 -0400
@@ -651,27 +651,37 @@
filechecklist:
if ( head == NULL ) {
if ( unlink( path ) != 0 ) {
- perror( path );
- goto error2;
- }
- if ( !quiet && !showprogress ) {
- printf( "%s: deleted\n", path );
- }
- if ( showprogress ) {
- progressupdate( PROGRESSUNIT, path );
- }
- } else {
- if ( ischildcase( path, head->path, case_sensitive )) {
- if ( unlink( path ) != 0 ) {
+ if ( !force || errno != ENOENT ) {
perror( path );
goto error2;
}
+ fprintf( stderr, "Warning: failed to remove %s: %s\n",
+ path, strerror( errno ));
+ } else {
if ( !quiet && !showprogress ) {
printf( "%s: deleted\n", path );
}
if ( showprogress ) {
progressupdate( PROGRESSUNIT, path );
}
+ }
+ } else {
+ if ( ischildcase( path, head->path, case_sensitive )) {
+ if ( unlink( path ) != 0 ) {
+ if ( !force || errno != ENOENT ) {
+ perror( path );
+ goto error2;
+ }
+ fprintf( stderr, "Warning: failed to remove %s: "
+ "%s\n", path, strerror( errno ));
+ } else {
+ if ( !quiet && !showprogress ) {
+ printf( "%s: deleted\n", path );
+ }
+ if ( showprogress ) {
+ progressupdate( PROGRESSUNIT, path );
+ }
+ }
} else {
/* remove head */
if ( rmdir( head->path ) != 0 ) {