Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql/src/port/dirmod.c,v retrieving revision 1.34 diff -c -c -r1.34 dirmod.c *** src/port/dirmod.c 31 Dec 2004 22:03:53 -0000 1.34 --- src/port/dirmod.c 12 Feb 2005 22:25:58 -0000 *************** *** 350,355 **** --- 350,356 ---- return filenames; } + /* * fnames_cleanup * *************** *** 366,371 **** --- 367,407 ---- pfree(filenames); } + + /* + * rmtree_errno + * + * report rmtree errno failure messages + */ + static void + rmtree_errno(char *filepath) + { + if (errno == EACCES) + #ifndef FRONTEND + elog(LOG, "no permission to remove \"%s\"", filepath); + #else + fprintf(stderr, "no permission to remove \"%s\"", filepath); + #endif + else if (errno == EBUSY) + #ifndef FRONTEND + elog(LOG, "can not remove \"%s\" because it is in use", filepath); + #else + fprintf(stderr, "can not remove \"%s\" because it is in use", filepath); + #endif + else if (errno == ENOENT) + #ifndef FRONTEND + elog(LOG, "\"%s\" disappeared during directory removal", filepath); + #else + fprintf(stderr, "\"%s\" disappeared during directory removal", filepath); + #endif + else + #ifndef FRONTEND + elog(LOG, "can not remove \"%s\"", filepath); + #else + fprintf(stderr, "can not remove \"%s\"", filepath); + #endif + } + /* * rmtree * *************** *** 399,404 **** --- 435,441 ---- if (stat(filepath, &statbuf) != 0) { + rmtree_errno(*filename); fnames_cleanup(filenames); return false; } *************** *** 416,421 **** --- 453,459 ---- { if (unlink(filepath) != 0) { + rmtree_errno(*filename); fnames_cleanup(filenames); return false; } *************** *** 426,431 **** --- 464,470 ---- { if (rmdir(path) != 0) { + rmtree_errno(*filename); fnames_cleanup(filenames); return false; }