|
5 | 5 | * Copyright (c) 2002-2010, PostgreSQL Global Development Group |
6 | 6 | * |
7 | 7 | * IDENTIFICATION |
8 | | - * $PostgreSQL: pgsql/src/backend/utils/adt/dbsize.c,v 1.27 2010/01/19 05:50:18 tgl Exp $ |
| 8 | + * $PostgreSQL: pgsql/src/backend/utils/adt/dbsize.c,v 1.28 2010/01/23 21:29:00 tgl Exp $ |
9 | 9 | * |
10 | 10 | */ |
11 | 11 |
|
@@ -46,6 +46,8 @@ db_dir_size(const char *path) |
46 | 46 | { |
47 | 47 | struct stat fst; |
48 | 48 |
|
| 49 | + CHECK_FOR_INTERRUPTS(); |
| 50 | + |
49 | 51 | if (strcmp(direntry->d_name, ".") == 0 || |
50 | 52 | strcmp(direntry->d_name, "..") == 0) |
51 | 53 | continue; |
@@ -104,6 +106,8 @@ calculate_database_size(Oid dbOid) |
104 | 106 |
|
105 | 107 | while ((direntry = ReadDir(dirdesc, dirpath)) != NULL) |
106 | 108 | { |
| 109 | + CHECK_FOR_INTERRUPTS(); |
| 110 | + |
107 | 111 | if (strcmp(direntry->d_name, ".") == 0 || |
108 | 112 | strcmp(direntry->d_name, "..") == 0) |
109 | 113 | continue; |
@@ -194,6 +198,8 @@ calculate_tablespace_size(Oid tblspcOid) |
194 | 198 | { |
195 | 199 | struct stat fst; |
196 | 200 |
|
| 201 | + CHECK_FOR_INTERRUPTS(); |
| 202 | + |
197 | 203 | if (strcmp(direntry->d_name, ".") == 0 || |
198 | 204 | strcmp(direntry->d_name, "..") == 0) |
199 | 205 | continue; |
@@ -262,6 +268,8 @@ calculate_relation_size(RelFileNode *rfn, ForkNumber forknum) |
262 | 268 | { |
263 | 269 | struct stat fst; |
264 | 270 |
|
| 271 | + CHECK_FOR_INTERRUPTS(); |
| 272 | + |
265 | 273 | if (segcount == 0) |
266 | 274 | snprintf(pathname, MAXPGPATH, "%s", |
267 | 275 | relationpath); |
|
0 commit comments