|
42 | 42 | * Portions Copyright (c) 1994, Regents of the University of California
|
43 | 43 | * Portions taken from FreeBSD.
|
44 | 44 | *
|
45 |
| - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.129 2007/01/20 17:04:58 momjian Exp $ |
| 45 | + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.130 2007/01/31 18:52:49 tgl Exp $ |
46 | 46 | *
|
47 | 47 | *-------------------------------------------------------------------------
|
48 | 48 | */
|
@@ -1041,10 +1041,26 @@ check_input(char *path)
|
1041 | 1041 | {
|
1042 | 1042 | structstatstatbuf;
|
1043 | 1043 |
|
1044 |
| -if (stat(path,&statbuf)!=0|| !S_ISREG(statbuf.st_mode)) |
| 1044 | +if (stat(path,&statbuf)!=0) |
| 1045 | +{ |
| 1046 | +if (errno==ENOENT) |
| 1047 | +fprintf(stderr, |
| 1048 | +_("%s: file \"%s\" does not exist\n" |
| 1049 | +"This means you have a corrupted installation or identified\n" |
| 1050 | +"the wrong directory with the invocation option -L.\n"), |
| 1051 | +progname,path); |
| 1052 | +else |
| 1053 | +fprintf(stderr, |
| 1054 | +_("%s: could not access file \"%s\": %s\n" |
| 1055 | +"This may mean you have a corrupted installation or identified\n" |
| 1056 | +"the wrong directory with the invocation option -L.\n"), |
| 1057 | +progname,path,strerror(errno)); |
| 1058 | +exit(1); |
| 1059 | +} |
| 1060 | +if (!S_ISREG(statbuf.st_mode)) |
1045 | 1061 | {
|
1046 | 1062 | fprintf(stderr,
|
1047 |
| -_("%s: file \"%s\"does notexist\n" |
| 1063 | +_("%s: file \"%s\"is nota regular file\n" |
1048 | 1064 | "This means you have a corrupted installation or identified\n"
|
1049 | 1065 | "the wrong directory with the invocation option -L.\n"),
|
1050 | 1066 | progname,path);
|
|