*** pgsql/src/port/Attic/copydir.c 2010/03/01 14:54:00 1.36 --- pgsql/src/port/Attic/copydir.c 2010/07/01 20:12:40 1.37 *************** *** 11,17 **** * as a service. * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/port/copydir.c,v 1.35 2010/03/01 00:04:06 stark Exp $ * *------------------------------------------------------------------------- */ --- 11,17 ---- * as a service. * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/port/copydir.c,v 1.36 2010/03/01 14:54:00 tgl Exp $ * *------------------------------------------------------------------------- */ *************** *** 23,28 **** --- 23,29 ---- #include #include "storage/fd.h" + #include "miscadmin.h" /* * On Windows, call non-macro versions of palloc; we can't reference *************** copydir(char *fromdir, char *todir, bool *** 69,74 **** --- 70,78 ---- { 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; *************** copy_file(char *fromfile, char *tofile) *** 172,177 **** --- 176,184 ---- */ 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,