*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.152 2005/08/14 18:49:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.153 2005/09/20 18:59:01 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
* process_file
*
* Read commands from filename and then them to the main processing loop
- * Handler for \i, but can be used for other things as well.
+ * Handler for \i, but can be used for other things as well. Returns
+ * MainLoop() error code.
*/
int
process_file(char *filename)
char *oldfilename;
if (!filename)
- return false;
+ return EXIT_FAILURE;
canonicalize_path(filename);
fd = fopen(filename, PG_BINARY_R);
if (!fd)
{
psql_error("%s: %s\n", filename, strerror(errno));
- return false;
+ return EXIT_FAILURE;
}
oldfilename = pset.inputfile;
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.122 2005/09/05 18:05:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.123 2005/09/20 18:59:02 momjian Exp $
*/
#include "postgres_fe.h"
sprintf(psqlrc, "%s-%s", filename, PG_VERSION);
if (access(psqlrc, R_OK) == 0)
- process_file(psqlrc);
+ (void)process_file(psqlrc);
else if (access(filename, R_OK) == 0)
- process_file(filename);
+ (void)process_file(filename);
free(psqlrc);
}