From: <st...@us...> - 2004-03-11 22:50:07
|
Update of /cvsroot/uts/uts/src/tel/teld In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11377/tel/teld Modified Files: instrument.c main.c runchild.c sec.c Log Message: Replaced fprintf(stderr, ...) with printf(...) to support output redirection. Index: instrument.c =================================================================== RCS file: /cvsroot/uts/uts/src/tel/teld/instrument.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** instrument.c 29 Jan 2004 03:03:21 -0000 1.1.1.1 --- instrument.c 11 Mar 2004 22:22:55 -0000 1.2 *************** *** 52,56 **** inst->sec = secconnect(secname , "w", SEC_INSTCLNT_IDENT); if (inst->sec == NULL) { ! fprintf(stderr, "*** Could not connect to Secretary %s.\n", secname); free(inst->name); --- 52,56 ---- inst->sec = secconnect(secname , "w", SEC_INSTCLNT_IDENT); if (inst->sec == NULL) { ! printf("*** Could not connect to Secretary %s.\n", secname); free(inst->name); *************** *** 95,99 **** sec = secconnect(secname, "r", inst->name); if (sec == NULL) { ! fprintf(stderr, "*** Could not connect to Secretary %s.\n", secname); return (EOF); --- 95,99 ---- sec = secconnect(secname, "r", inst->name); if (sec == NULL) { ! printf("*** Could not connect to Secretary %s.\n", secname); return (EOF); Index: main.c =================================================================== RCS file: /cvsroot/uts/uts/src/tel/teld/main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.c 11 Mar 2004 20:42:07 -0000 1.4 --- main.c 11 Mar 2004 22:23:10 -0000 1.5 *************** *** 70,77 **** /* Open log file and redirect stdout, if required */ if (logfname != NULL) { ! fprintf(stderr, " -> Logging to file \"%s\".\n", logfname); stdout = freopen(logfname, "a", stdout); if (stdout == NULL) { ! fprintf(stderr, "*** Error opening file \"%s\".\n", logfname); exit(1); --- 70,77 ---- /* Open log file and redirect stdout, if required */ if (logfname != NULL) { ! printf(" -> Logging to file \"%s\".\n", logfname); stdout = freopen(logfname, "a", stdout); if (stdout == NULL) { ! printf("*** Error opening file \"%s\".\n", logfname); exit(1); *************** *** 90,94 **** if (detach) { /* Detach from terminal (daemon mode) */ ! fprintf(stderr, " -> Jumping into background...\n\n"); goto_bg(); /* close stdout if no logfile specified */ --- 90,94 ---- if (detach) { /* Detach from terminal (daemon mode) */ ! printf(" -> Jumping into background...\n\n"); goto_bg(); /* close stdout if no logfile specified */ Index: runchild.c =================================================================== RCS file: /cvsroot/uts/uts/src/tel/teld/runchild.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** runchild.c 9 Mar 2004 22:50:03 -0000 1.2 --- runchild.c 11 Mar 2004 22:23:10 -0000 1.3 *************** *** 45,58 **** res = system(child_cmdline); ! fprintf(stderr, "Child process ended with status: %d\n", res); exit(EOF); /* this ends the child process, not the daemon */ } else if (chpid == -1) { ! fprintf(stderr, "Error, could not fork processes.\n"); } else { /* i am the parent */ ! fprintf(stderr, "Child process created, pid=%d.\n", chpid); } return(chpid); --- 45,58 ---- res = system(child_cmdline); ! printf("Child process ended with status: %d\n", res); exit(EOF); /* this ends the child process, not the daemon */ } else if (chpid == -1) { ! printf("Error, could not fork processes.\n"); } else { /* i am the parent */ ! printf("Child process created, pid=%d.\n", chpid); } return(chpid); Index: sec.c =================================================================== RCS file: /cvsroot/uts/uts/src/tel/teld/sec.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sec.c 29 Jan 2004 03:03:21 -0000 1.1.1.1 --- sec.c 11 Mar 2004 22:23:10 -0000 1.2 *************** *** 161,170 **** res = secreadb(sec->skt, buf); if (res < 0) { ! fprintf(stderr, "Read timeout or socket error\n\n"); secclose(sec); return (NULL); } if (res != RES_HELLO) { ! fprintf(stderr, "Expected \"%s\", but got \"%s\"\n", fresponses[RES_HELLO], fresponses[res]); secclose(sec); --- 161,170 ---- res = secreadb(sec->skt, buf); if (res < 0) { ! printf("Read timeout or socket error\n\n"); secclose(sec); return (NULL); } if (res != RES_HELLO) { ! printf("Expected \"%s\", but got \"%s\"\n", fresponses[RES_HELLO], fresponses[res]); secclose(sec); *************** *** 185,194 **** res = secreadb(sec->skt, buf); if (res < 0) { ! fprintf(stderr, "Read timeout or socket error\n\n"); secclose(sec); return (NULL); } if (res != RES_OK) { ! fprintf(stderr, "Unexpected response on IDENT: \"%s\"\n", fresponses[res]); secclose(sec); --- 185,194 ---- res = secreadb(sec->skt, buf); if (res < 0) { ! printf("Read timeout or socket error\n\n"); secclose(sec); return (NULL); } if (res != RES_OK) { ! printf("Unexpected response on IDENT: \"%s\"\n", fresponses[res]); secclose(sec); *************** *** 271,280 **** res = secreadb(sec->skt, buf); if (res < 0) { ! fprintf(stderr, "Read timeout or socket error\n\n"); Sclose(sec); return (EOF); } if (res != RES_OK) { ! fprintf(stderr, "Error setting status %d = %s\n", stat, content); } --- 271,280 ---- res = secreadb(sec->skt, buf); if (res < 0) { ! printf("Read timeout or socket error\n\n"); Sclose(sec); return (EOF); } if (res != RES_OK) { ! printf("Error setting status %d = %s\n", stat, content); } |