index 0927e62fe61f23f99364d3d56986a9ccdbcbd58a..b9c6a9a6104519e4a8f89c2fca301944fcc59fab 100644 (file)
* as a service.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/copydir.c,v 1.36 2010年03月01日 14:54:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/port/copydir.c,v 1.37 2010年07月01日 20:12:40 rhaas Exp $
*
*-------------------------------------------------------------------------
*/
#include <sys/stat.h>
#include "storage/fd.h"
+#include "miscadmin.h"
/*
* On Windows, call non-macro versions of palloc; we can't reference
@@ -69,6 +70,9 @@ copydir(char *fromdir, char *todir, bool recurse)
{
struct stat fst;
+ /* If we got a cancel signal during the copy of the directory, quit */
+ CHECK_FOR_INTERRUPTS();
+
if (strcmp(xlde->d_name, ".") == 0 ||
strcmp(xlde->d_name, "..") == 0)
continue;
*/
for (offset = 0;; offset += nbytes)
{
+ /* If we got a cancel signal during the copy of the file, quit */
+ CHECK_FOR_INTERRUPTS();
+
nbytes = read(srcfd, buffer, COPY_BUF_SIZE);
if (nbytes < 0)
ereport(ERROR,