mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
pgindent copy.c. Patch wasn't in proper format.
This commit is contained in:
parent
0cd8cb1a03
commit
87675fab6f
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.147 2002/02/24 02:32:26 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.148 2002/02/24 02:33:33 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -327,6 +327,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
fp = AllocateFile(filename, PG_BINARY_R);
|
fp = AllocateFile(filename, PG_BINARY_R);
|
||||||
|
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
@ -335,10 +336,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
|||||||
"reading. Errno = %s (%d).",
|
"reading. Errno = %s (%d).",
|
||||||
(int) geteuid(), filename, strerror(errno), errno);
|
(int) geteuid(), filename, strerror(errno), errno);
|
||||||
|
|
||||||
fstat(fileno(fp),&st);
|
fstat(fileno(fp), &st);
|
||||||
if( S_ISDIR(st.st_mode) ){
|
if (S_ISDIR(st.st_mode))
|
||||||
|
{
|
||||||
FreeFile(fp);
|
FreeFile(fp);
|
||||||
elog(ERROR,"COPY: %s is a directory.",filename);
|
elog(ERROR, "COPY: %s is a directory.", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CopyFrom(rel, binary, oids, fp, delim, null_print);
|
CopyFrom(rel, binary, oids, fp, delim, null_print);
|
||||||
@ -387,10 +389,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
|
|||||||
"effective uid %d, could not open file '%s' for "
|
"effective uid %d, could not open file '%s' for "
|
||||||
"writing. Errno = %s (%d).",
|
"writing. Errno = %s (%d).",
|
||||||
(int) geteuid(), filename, strerror(errno), errno);
|
(int) geteuid(), filename, strerror(errno), errno);
|
||||||
fstat(fileno(fp),&st);
|
fstat(fileno(fp), &st);
|
||||||
if( S_ISDIR(st.st_mode) ){
|
if (S_ISDIR(st.st_mode))
|
||||||
|
{
|
||||||
FreeFile(fp);
|
FreeFile(fp);
|
||||||
elog(ERROR,"COPY: %s is a directory.",filename);
|
elog(ERROR, "COPY: %s is a directory.", filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CopyTo(rel, binary, oids, fp, delim, null_print);
|
CopyTo(rel, binary, oids, fp, delim, null_print);
|
||||||
@ -1097,25 +1100,25 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline, char *null_
|
|||||||
if (ISOCTAL(c))
|
if (ISOCTAL(c))
|
||||||
{
|
{
|
||||||
val = (val << 3) + OCTVALUE(c);
|
val = (val << 3) + OCTVALUE(c);
|
||||||
CopyDonePeek(fp, c, true /*pick up*/);
|
CopyDonePeek(fp, c, true /* pick up */ );
|
||||||
c = CopyPeekChar(fp);
|
c = CopyPeekChar(fp);
|
||||||
if (ISOCTAL(c))
|
if (ISOCTAL(c))
|
||||||
{
|
{
|
||||||
val = (val << 3) + OCTVALUE(c);
|
val = (val << 3) + OCTVALUE(c);
|
||||||
CopyDonePeek(fp, c, true /*pick up*/);
|
CopyDonePeek(fp, c, true /* pick up */ );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
goto endOfFile;
|
goto endOfFile;
|
||||||
CopyDonePeek(fp, c, false /*put back*/);
|
CopyDonePeek(fp, c, false /* put back */ );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
goto endOfFile;
|
goto endOfFile;
|
||||||
CopyDonePeek(fp, c, false /*put back*/);
|
CopyDonePeek(fp, c, false /* put back */ );
|
||||||
}
|
}
|
||||||
c = val & 0377;
|
c = val & 0377;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user