summaryrefslogtreecommitdiff
path: root/net/xferstats/files/patch-parselog.c
diff options
context:
space:
mode:
authorAdam Weinberger <adamw@FreeBSD.org>2014-07-29 01:59:16 +0000
committerAdam Weinberger <adamw@FreeBSD.org>2014-07-29 01:59:16 +0000
commit69ea23ed7175d5c34a21bba1ef9262f311c69284 (patch)
treee2e604e83659be7f58596e80b3cf18e9d7d06dae /net/xferstats/files/patch-parselog.c
parentStage net-mgmt/routers2 and cleanup (diff)
Rename net/ patch-xy patches to reflect the files they modify.
Approve by: portmgr (not really, but one of these is modifying an unstaged port)
Notes
Notes: svn path=/head/; revision=363285
Diffstat (limited to 'net/xferstats/files/patch-parselog.c')
-rw-r--r--net/xferstats/files/patch-parselog.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/net/xferstats/files/patch-parselog.c b/net/xferstats/files/patch-parselog.c
new file mode 100644
index 000000000000..6a0da013c765
--- /dev/null
+++ b/net/xferstats/files/patch-parselog.c
@@ -0,0 +1,84 @@
+--- parselog.c.orig Sun Oct 13 17:39:55 2002
++++ parselog.c Sun Oct 13 17:42:12 2002
+@@ -202,15 +202,11 @@
+
+ while (1) {
+ if (pointers->config->use_stdin) {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, sizeof(foo), stdin);
+ } else {
+- if (feof(log_stream))
++ if (fgets(foo, sizeof(foo), log_stream) == NULL)
+ break;
+-
+- fgets(foo, sizeof(foo), log_stream);
+ }
+
+ if ((len = strlen(foo)) < 42)
+@@ -455,10 +451,8 @@
+ #ifdef HAVE_MMAP
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, sizeof(foo), stdin);
+ }
+ else
+ {
+@@ -497,17 +491,13 @@
+ #else /* HAVE_MMAP */
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, sizeof(foo), stdin);
+ }
+ else
+ {
+- if (feof(log_stream))
++ if (fgets(foo, sizeof(foo), log_stream) == NULL)
+ break;
+-
+- fgets(foo, sizeof(foo), log_stream);
+ }
+ #endif /* HAVE_MMAP */
+
+@@ -770,10 +760,8 @@
+ #ifdef HAVE_MMAP
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, 2047, stdin);
+ }
+ else
+ {
+@@ -812,17 +800,13 @@
+ #else /* HAVE_MMAP */
+ if (pointers->config->use_stdin)
+ {
+- if (feof(stdin))
++ if (fgets(foo, sizeof(foo), stdin) == NULL)
+ break;
+- /* there's probably a better way to do this :) */
+- fgets(foo, 2047, stdin);
+ }
+ else
+ {
+- if (feof(log_stream))
++ if (fgets(foo, sizeof(foo), log_stream) == NULL)
+ break;
+-
+- fgets(foo, sizeof(foo), log_stream);
+ }
+ #endif /* HAVE_MMAP */
+