]> hackdaworld.org Git - my-code/hdw-sniff.git/commitdiff
O_APPEND for log file
authorhackbard <hackbard>
Thu, 2 Jun 2005 21:35:50 +0000 (21:35 +0000)
committerhackbard <hackbard>
Thu, 2 Jun 2005 21:35:50 +0000 (21:35 +0000)
main.c

diff --git a/main.c b/main.c
index fda8c45b18a393bf96824712b812e005967001fe..4a878cfb80777d915815cdbf7d0d8db04fe59cde 100644 (file)
--- 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 ...");