1
1
/*
2
2
* These are replacement versions of unlink and rename that work on
3
3
* Win32 (NT, Win2k, XP). replace() doesn't work on Win95/98/Me.
4
- *
5
4
*/
6
5
7
6
#ifndef TEST_VERSION
11
10
#undef rename
12
11
#undef unlink
13
12
14
- int pgrename (const char * from , const char * to )
13
+ int
14
+ pgrename (const char * from , const char * to )
15
15
{
16
16
int loops = 0 ;
17
17
@@ -23,24 +23,27 @@ int pgrename(const char *from, const char *to)
23
23
Sleep (100 ); /* ms */
24
24
if (loops == 10 )
25
25
#ifndef FRONTEND
26
- elog (LOG , "Unable to rename %s to %s, continuing to try" , from , to );
26
+ elog (LOG , "could not rename \"%s\" to \"%s\", continuing to try" ,
27
+ from , to );
27
28
#else
28
- fprintf (stderr , "Unable to rename %s to %s, continuing to try\n" , from , to );
29
+ fprintf (stderr , "could not rename \"%s\" to \"%s\", continuing to try\n" ,
30
+ from , to );
29
31
#endif
30
32
loops ++ ;
31
33
}
32
34
33
35
if (loops > 10 )
34
36
#ifndef FRONTEND
35
- elog (LOG , "Completed rename of %s to %s " , from , to );
37
+ elog (LOG , "completed rename of \"%s\" to \"%s\" " , from , to );
36
38
#else
37
- fprintf (stderr , "Completed rename of %s to %s \n" , from , to );
39
+ fprintf (stderr , "completed rename of \"%s\" to \"%s\" \n" , from , to );
38
40
#endif
39
41
return 0 ;
40
42
}
41
43
42
44
43
- int pgunlink (const char * path )
45
+ int
46
+ pgunlink (const char * path )
44
47
{
45
48
int loops = 0 ;
46
49
@@ -52,18 +55,20 @@ int pgunlink(const char *path)
52
55
Sleep (100 ); /* ms */
53
56
if (loops == 10 )
54
57
#ifndef FRONTEND
55
- elog (LOG , "Unable to unlink %s, continuing to try" , path );
58
+ elog (LOG , "could not unlink \"%s\", continuing to try" ,
59
+ path );
56
60
#else
57
- fprintf (stderr , "Unable to unlink %s, continuing to try\n" , path );
61
+ fprintf (stderr , "could not unlink \"%s\", continuing to try\n" ,
62
+ path );
58
63
#endif
59
64
loops ++ ;
60
65
}
61
66
62
67
if (loops > 10 )
63
68
#ifndef FRONTEND
64
- elog (LOG , "Completed unlink of %s " , path );
69
+ elog (LOG , "completed unlink of \"%s\" " , path );
65
70
#else
66
- fprintf (stderr , "Completed unlink of %s \n" , path );
71
+ fprintf (stderr , "completed unlink of \"%s\" \n" , path );
67
72
#endif
68
73
return 0 ;
69
74
}
@@ -143,4 +148,5 @@ main(int argc, char* argv[])
143
148
144
149
return 0 ;
145
150
}
151
+
146
152
#endif
0 commit comments