Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9216c89

Browse files
committed
rmtree() reported the wrong pathname if final rmdir failed.
1 parent35c4764 commit9216c89

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

‎src/port/dirmod.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*Win32 (NT, Win2k, XP).replace() doesn't work on Win95/98/Me.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.37 2005/03/24 02:11:20 tgl Exp $
13+
* $PostgreSQL: pgsql/src/port/dirmod.c,v 1.38 2005/08/02 15:14:47 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -281,10 +281,10 @@ pgsymlink(const char *oldpath, const char *newpath)
281281
#ifndefFRONTEND
282282
ereport(ERROR,
283283
(errcode_for_file_access(),
284-
errmsg("Error settingjunction for%s: %s",
284+
errmsg("could not setjunction for\"%s\": %s",
285285
nativeTarget,msg)));
286286
#else
287-
fprintf(stderr,_("Error settingjunction for%s: %s\n"),
287+
fprintf(stderr,_("could not setjunction for\"%s\": %s\n"),
288288
nativeTarget,msg);
289289
#endif
290290
LocalFree(msg);
@@ -408,7 +408,8 @@ fnames_cleanup(char **filenames)
408408
bool
409409
rmtree(char*path,boolrmtopdir)
410410
{
411-
charfilepath[MAXPGPATH];
411+
charpathbuf[MAXPGPATH];
412+
char*filepath;
412413
char**filenames;
413414
char**filename;
414415
structstatstatbuf;
@@ -423,6 +424,7 @@ rmtree(char *path, bool rmtopdir)
423424
return false;
424425

425426
/* now we have the names we can start removing things */
427+
filepath=pathbuf;
426428

427429
for (filename=filenames;*filename;filename++)
428430
{
@@ -450,7 +452,8 @@ rmtree(char *path, bool rmtopdir)
450452

451453
if (rmtopdir)
452454
{
453-
if (rmdir(path)!=0)
455+
filepath=path;
456+
if (rmdir(filepath)!=0)
454457
gotoreport_and_fail;
455458
}
456459

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp