Changed error messages in main.C to print user names

svn path=/trunk/boinc/; revision=186
This commit is contained in:
Barry Luong 2002-07-12 17:44:49 +00:00
parent 099756fc76
commit 9d328bfc1d
3 changed files with 12 additions and 12 deletions

View File

@ -11,9 +11,10 @@ CFLAGS = -g -Wall @DEFS@ \
-I@top_srcdir@/tools \ -I@top_srcdir@/tools \
-DBOINC_DB_NAME=\"$(BOINC_DB_NAME)\" \ -DBOINC_DB_NAME=\"$(BOINC_DB_NAME)\" \
-DBOINC_KEY=$(BOINC_KEY) \ -DBOINC_KEY=$(BOINC_KEY) \
-DBOINC_KEY_DIR=\"$(BOINC_KEY_DIR)\" \
-DBOINC_USER=\"$(BOINC_USER)\" \
-I/usr/local/mysql/include \ -I/usr/local/mysql/include \
-I@top_srcdir@/RSAEuro/source \ -I@top_srcdir@/RSAEuro/source \
-DBOINC_KEY_DIR=\"$(BOINC_KEY_DIR)\" \
CC = g++ $(CFLAGS) CC = g++ $(CFLAGS)

View File

@ -172,7 +172,6 @@ int main(int argc, char** argv) {
int i, retval; int i, retval;
bool asynch = false; bool asynch = false;
void* p; void* p;
char* barry;
for (i=1; i<argc; i++) { for (i=1; i<argc; i++) {
if (!strcmp(argv[i], "-asynch")) { if (!strcmp(argv[i], "-asynch")) {

View File

@ -57,36 +57,36 @@ int main() {
retval = read_file_malloc(path, code_sign_key); retval = read_file_malloc(path, code_sign_key);
if (retval) { if (retval) {
fprintf(stderr, fprintf(stderr,
"BOINC scheduler: can't read code sign key file (%s)\n", path "BOINC scheduler - compiled by BOINC_USER: can't read code sign key file (%s)\n", path
); );
exit(1); exit(1);
} }
retval = attach_shmem(BOINC_KEY, &p); retval = attach_shmem(BOINC_KEY, &p);
if (retval) { if (retval) {
fprintf(stderr, "BOINC scheduler: can't attach shmem\n"); fprintf(stderr, "BOINC scheduler - Compiled by BOINC_USER: can't attach shmem\n");
exit(1); exit(1);
} }
ssp = (SCHED_SHMEM*)p; ssp = (SCHED_SHMEM*)p;
retval = ssp->verify(); retval = ssp->verify();
if (retval) { if (retval) {
fprintf(stderr, "BOINC scheduler: shmem has wrong struct sizes - recompile\n"); fprintf(stderr, "BOINC scheduler - Compiled by BOINC_USER: shmem has wrong struct sizes - recompile\n");
exit(1); exit(1);
} }
for (i=0; i<10; i++) { for (i=0; i<10; i++) {
if (ssp->ready) break; if (ssp->ready) break;
fprintf(stderr, "BOINC scheduler: waiting for ready flag\n"); fprintf(stderr, "BOINC scheduler - Compiled by BOINC_USER: waiting for ready flag\n");
sleep(1); sleep(1);
} }
if (!ssp->ready) { if (!ssp->ready) {
fprintf(stderr, "BOINC scheduler: feeder doesn't seem to be running\n"); fprintf(stderr, "BOINC scheduler - Compiled by BOINC_USER: feeder doesn't seem to be running\n");
exit(1); exit(1);
} }
//fprintf(stderr, "got ready flag\n"); //fprintf(stderr, "got ready flag\n");
retval = db_open(BOINC_DB_NAME); retval = db_open(BOINC_DB_NAME);
if (retval) { if (retval) {
exit(return_error("BOINC scheduler: can't open database")); exit(return_error("BOINC scheduler - Compiled by BOINC_USER: can't open database"));
} }
pid = getpid(); pid = getpid();
#ifdef _USING_FCGI_ #ifdef _USING_FCGI_
@ -98,24 +98,24 @@ int main() {
fprintf(stdout, "Content-type: text/plain\n\n"); fprintf(stdout, "Content-type: text/plain\n\n");
fout = fopen(req_path, "w"); fout = fopen(req_path, "w");
if (!fout) { if (!fout) {
exit(return_error("can't write request file")); exit(return_error("Compiled by BOINC_USER: can't write request file"));
} }
copy_stream(stdin, fout); copy_stream(stdin, fout);
fclose(fout); fclose(fout);
fin = fopen(req_path, "r"); fin = fopen(req_path, "r");
if (!fin) { if (!fin) {
exit(return_error("can't read request file")); exit(return_error("Compiled by BOINC_USER: can't read request file"));
} }
fout = fopen(reply_path, "w"); fout = fopen(reply_path, "w");
if (!fout) { if (!fout) {
exit(return_error("can't write reply file")); exit(return_error("Compiled by BOINC_USER: can't write reply file"));
} }
handle_request(fin, fout, *ssp, code_sign_key); handle_request(fin, fout, *ssp, code_sign_key);
fclose(fin); fclose(fin);
fclose(fout); fclose(fout);
fin = fopen(reply_path, "r"); fin = fopen(reply_path, "r");
if (!fin) { if (!fin) {
exit(return_error("can't read reply file")); exit(return_error("Compiled by BOINC_USER: can't read reply file"));
} }
copy_stream(fin, stdout); copy_stream(fin, stdout);
fclose(fin); fclose(fin);