From: hackbard Date: Thu, 2 Jun 2005 21:35:50 +0000 (+0000) Subject: O_APPEND for log file X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=065c77e28f2f7c79e73ad1bd52cf5ad8ce3c3127;p=my-code%2Fhdw-sniff.git O_APPEND for log file --- diff --git a/main.c b/main.c index fda8c45..4a878cf 100644 --- a/main.c +++ b/main.c @@ -193,7 +193,7 @@ int main(int argc, char **argv) { ++i; break; case 'l': - if((info.log_fd=open(argv[i+1],O_RDWR|O_CREAT))!=0) + if((info.log_fd=open(argv[i+1],O_RDWR|O_CREAT|O_APPEND))!=0) printf("logfile -> %s\n",argv[i+1]); else puts("warning: can't write to logfile."); @@ -231,7 +231,7 @@ int main(int argc, char **argv) { system(sys_call); if(info.log_fd==0) { - if((info.log_fd=open("/tmp/hdw-sniff.log",O_RDWR|O_CREAT))!=0) + if((info.log_fd=open("/tmp/hdw-sniff.log",O_RDWR|O_CREAT|O_APPEND))!=0) puts("using logfile /tmp/hdw-sniff.log ..."); else { puts("failed to open logfile ...");