[BACK]Return to patch-sn__logfile_c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / net / sniffit / patches

File: [cvs.NetBSD.org] / pkgsrc / net / sniffit / patches / patch-sn__logfile_c (download)

Revision 1.1, Sat Mar 31 08:31:06 2012 UTC (8 years, 4 months ago) by dholland
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, pkgsrc-2015Q4-base, pkgsrc-2015Q4, pkgsrc-2015Q3-base, pkgsrc-2015Q3, pkgsrc-2015Q2-base, pkgsrc-2015Q2, pkgsrc-2015Q1-base, pkgsrc-2015Q1, pkgsrc-2014Q4-base, pkgsrc-2014Q4, pkgsrc-2014Q3-base, pkgsrc-2014Q3, pkgsrc-2014Q2-base, pkgsrc-2014Q2, pkgsrc-2014Q1-base, pkgsrc-2014Q1, pkgsrc-2013Q4-base, pkgsrc-2013Q4, pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2, pkgsrc-2013Q1-base, pkgsrc-2013Q1, pkgsrc-2012Q4-base, pkgsrc-2012Q4, pkgsrc-2012Q3-base, pkgsrc-2012Q3, pkgsrc-2012Q2-base, pkgsrc-2012Q2, pkgsrc-2012Q1-base, pkgsrc-2012Q1, HEAD

Patch up various lethal compiler warnings. This still doesn't build
on NetBSD current or probably -6 because of bpf issues, but now stands
a chance of being able to run on LP64 platforms and/or at all when that's
fixed.

$NetBSD: patch-sn__logfile_c,v 1.1 2012/03/31 08:31:06 dholland Exp $

- Use standard headers.
- Call fchmod correctly.

--- sn_logfile.c.orig	1997-04-18 09:33:58.000000000 +0000
+++ sn_logfile.c
@@ -4,6 +4,8 @@
 #include "sn_config.h"
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include "sn_defines.h"
@@ -81,7 +83,7 @@ LogFILE=fopen(Logfile,"a");
 if(LogFILE==NULL)
   printf("Sniffit hardattack.. couldn't create/open logfile...\n"), exit(1); 
 exit_func(logfile_exit);
-fchmod(LogFILE,  S_IWUSR|S_IRUSR);
+fchmod(fileno(LogFILE),  S_IWUSR|S_IRUSR);
 print_logline("Sniffit session started.");
 printf("Sniffit Logging started. (loglevel: %d)\n",LOGLEVEL);
 }