|
10 | 10 | *
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.105 1999/05/25 16:10:40 momjian Exp $ |
| 13 | + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.106 1999/06/04 21:14:46 tgl Exp $ |
14 | 14 | *
|
15 | 15 | * NOTES
|
16 | 16 | *
|
@@ -427,7 +427,7 @@ PostmasterMain(int argc, char *argv[])
|
427 | 427 | * means we have to start each backend with a -B # to make
|
428 | 428 | * sure they know how many buffers were allocated.
|
429 | 429 | */
|
430 |
| -NBuffers=atol(optarg); |
| 430 | +NBuffers=atoi(optarg); |
431 | 431 | strcat(ExtraOptions," -B ");
|
432 | 432 | strcat(ExtraOptions,optarg);
|
433 | 433 | break;
|
@@ -530,9 +530,26 @@ PostmasterMain(int argc, char *argv[])
|
530 | 530 | break;
|
531 | 531 | }
|
532 | 532 | }
|
| 533 | + |
| 534 | +/* |
| 535 | + * Select default values for switches where needed |
| 536 | + */ |
533 | 537 | if (PostPortName==-1)
|
534 | 538 | PostPortName=pq_getport();
|
535 | 539 |
|
| 540 | +/* |
| 541 | + * Check for invalid combinations of switches |
| 542 | + */ |
| 543 | +if (NBuffers<2*MaxBackends||NBuffers<16) |
| 544 | +{ |
| 545 | +/* Do not accept -B so small that backends are likely to starve for |
| 546 | + * lack of buffers. The specific choices here are somewhat arbitrary. |
| 547 | + */ |
| 548 | +fprintf(stderr,"%s: -B must be at least twice -N and at least 16.\n", |
| 549 | +progname); |
| 550 | +exit(1); |
| 551 | +} |
| 552 | + |
536 | 553 | checkDataDir(DataDir,&DataDirOK);/* issues error messages */
|
537 | 554 | if (!DataDirOK)
|
538 | 555 | {
|
|