From 549ec595d1da7693d5f7730e63f539cc8452307f Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sat, 6 Sep 1997 22:48:00 -0400 Subject: snapshot of project "lynx", label v2-7-1ac_0-60 --- src/LYMainLoop.c | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) (limited to 'src/LYMainLoop.c') diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 5a7b3fe4..4a712098 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -393,14 +393,7 @@ try_again: fflush(stderr); fclose(LYTraceLogFP); *stderr = LYOrigStderr; -#ifdef VMS - if ((LYTraceLogFP = fopen(LYTraceLogPath, - "a+", "shr=get")) == NULL) -#else - if ((LYTraceLogFP = fopen(LYTraceLogPath, - "a+")) == NULL) -#endif /* VMS */ - { + if ((LYTraceLogFP = LYAppendToTxtFile(LYTraceLogPath)) == NULL) { WWW_TraceFlag = FALSE; _statusline(TRACELOG_OPEN_FAILED); sleep(MessageSecs); @@ -507,8 +500,8 @@ try_again: if (traversal && !first_file && !LYCancelledFetch) { FILE *ofp; - if ((ofp = fopen(TRAVERSE_ERRORS,"a+")) == NULL) { - if ((ofp = fopen(TRAVERSE_ERRORS,"w")) == NULL) { + if ((ofp = LYAppendToTxtFile(TRAVERSE_ERRORS)) == NULL) { + if ((ofp = LYNewTxtFile(TRAVERSE_ERRORS)) == NULL) { perror(NOOPEN_TRAV_ERR_FILE); #ifndef NOSIGHUP (void) signal(SIGHUP, SIG_DFL); @@ -523,9 +516,6 @@ try_again: #endif /* SIGTSTP */ exit(-1); } -#ifndef __DJGPP__ - chmod(TRAVERSE_ERRORS, 0600); -#endif /* __DJGPP__ */ } fprintf(ofp, "%s %s\tin %s\n", links[curdoc.link].lname, @@ -1338,10 +1328,7 @@ try_again: crawl_ok = FALSE; sprintf(cfile,"lnk%08d.dat",ccount); ccount = ccount + 1; - if ((cfp = fopen(cfile,"w")) != NULL) { -#ifndef __DJGPP__ - chmod(cfile, 0600); -#endif /* __DJGPP__ */ + if ((cfp = LYNewTxtFile(cfile)) != NULL) { print_crawl_to_fd(cfp,curdoc.address,curdoc.title); fclose(cfp); } else { @@ -4538,7 +4525,7 @@ check_add_bookmark_to_self: * attempting to read the log via the TRACE_LOG * command. - FM */ - if ((LYTraceLogFP = fopen(LYTraceLogPath, "w")) == NULL) { + if ((LYTraceLogFP = LYNewTxtFile(LYTraceLogPath)) == NULL) { WWW_TraceFlag = FALSE; _statusline(TRACELOG_OPEN_FAILED); sleep(MessageSecs); @@ -4548,17 +4535,13 @@ check_add_bookmark_to_self: fclose(LYTraceLogFP); while (remove(LYTraceLogPath) == 0) ; - if ((LYTraceLogFP = fopen(LYTraceLogPath, "w", - "shr=get")) == NULL) { + if ((LYTraceLogFP = LYNewTxtFile(LYTraceLogPath)) == NULL) { WWW_TraceFlag == FALSE; _statusline(TRACELOG_OPEN_FAILED); sleep(MessageSecs); break; } #endif /* VMS */ -#ifndef __DJGPP__ - chmod(LYTraceLogPath, 0600); -#endif /* __DJGPP__ */ *stderr = *LYTraceLogFP; fprintf(stderr, "\t\t%s\n\n", LYNX_TRACELOG_TITLE); } @@ -4598,14 +4581,7 @@ check_add_bookmark_to_self: fflush(stderr); fclose(LYTraceLogFP); *stderr = LYOrigStderr; -#ifdef VMS - if ((LYTraceLogFP = fopen(LYTraceLogPath, - "a+", "shr=get")) == NULL) -#else - if ((LYTraceLogFP = fopen(LYTraceLogPath, - "a+")) == NULL) -#endif /* VMS */ - { + if ((LYTraceLogFP = LYAppendToTxtFile(LYTraceLogPath)) == NULL) { WWW_TraceFlag = FALSE; _statusline(TRACELOG_OPEN_FAILED); sleep(MessageSecs); -- cgit 1.4.1-2-gfad0 n1'>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101