pkgsrc/net/sniffit/patches/patch-sn__logfile_c
dholland 3fade87443 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.
2012-03-31 08:31:06 +00:00

25 lines
731 B
Text

$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);
}