aboutsummaryrefslogtreecommitdiff
path: root/print/cups-bjnp/files
diff options
context:
space:
mode:
authorDanilo Egea Gondolfo <danilo@FreeBSD.org>2014-09-07 13:34:45 +0000
committerDanilo Egea Gondolfo <danilo@FreeBSD.org>2014-09-07 13:34:45 +0000
commit3cd2a6d99b4fcbf0e61cd9b51123abf861f24995 (patch)
tree367af321821ae9ae22fc91fa725238f563165974 /print/cups-bjnp/files
parentc53e81253489251baa56c857391f7e74ac9400a7 (diff)
downloadports-3cd2a6d99b4fcbf0e61cd9b51123abf861f24995.tar.gz
ports-3cd2a6d99b4fcbf0e61cd9b51123abf861f24995.zip
Notes
Diffstat (limited to 'print/cups-bjnp/files')
-rw-r--r--print/cups-bjnp/files/patch-bjnp-debug.c104
1 files changed, 52 insertions, 52 deletions
diff --git a/print/cups-bjnp/files/patch-bjnp-debug.c b/print/cups-bjnp/files/patch-bjnp-debug.c
index 19c8dbd627c1..7a7b3bfb722c 100644
--- a/print/cups-bjnp/files/patch-bjnp-debug.c
+++ b/print/cups-bjnp/files/patch-bjnp-debug.c
@@ -1,6 +1,6 @@
---- bjnp-debug.c.orig 2013-01-21 10:43:27.000000000 -0800
-+++ bjnp-debug.c 2013-08-14 02:29:30.000000000 -0700
-@@ -19,7 +19,7 @@
+--- bjnp-debug.c.orig 2014-09-06 12:38:15 UTC
++++ bjnp-debug.c
+@@ -20,7 +20,7 @@
#include <stdio.h>
#include <stdarg.h>
@@ -9,64 +9,64 @@
#include <errno.h>
#include "bjnp.h"
-@@ -59,7 +59,7 @@
- static int to_cups = 0;
+@@ -58,7 +58,7 @@
+ static bjnp_loglevel_t debug_level = LOG_ERROR;
static FILE *debug_file = NULL;
static time_t start_sec = 0;
-static int start_msec;
+static suseconds_t start_usec;
- /*
+ /*
* local functions
-@@ -186,9 +186,9 @@
+@@ -192,9 +192,9 @@
{
- va_list ap;
- char printbuf[256];
-- struct timeb timebuf;
-+ struct timeval timebuf;
- int sec;
-- int msec;
-+ suseconds_t usec;
+ va_list ap;
+ char printbuf[1024];
+- struct timeb timebuf;
++ struct timeval timebuf;
+ int sec;
+- int msec;
++ suseconds_t usec;
- /* print received data into a string */
- va_start (ap, fmt);
-@@ -204,15 +204,15 @@
+ if (level <= debug_level) {
+ /* print received data into a string */
+@@ -211,16 +211,16 @@
+ /* all log messages may go to the own logfile */
- if ((level <= debug_level) && debug_file)
- {
-- ftime (&timebuf);
-- if ((msec = timebuf.millitm - start_msec) < 0)
-+ gettimeofday (&timebuf, NULL);
-+ if ((usec = timebuf.tv_usec - start_usec) < 0)
- {
-- msec += 1000;
-- timebuf.time -= 1;
-+ usec += 1000000;
-+ timebuf.tv_sec -= 1;
- }
-- sec = timebuf.time - start_sec;
-+ sec = timebuf.tv_sec - start_sec;
+ if (debug_file != NULL) {
+- ftime(&timebuf);
++ gettimeofday (&timebuf, NULL);
-- fprintf (debug_file, "%8s: %03d.%03d %s", level2str (level), sec, msec,
-+ fprintf (debug_file, "%8s: %03d.%06ld %s", level2str (level), sec, usec,
- printbuf);
- }
- }
-@@ -224,13 +224,13 @@
- * set debug level to level (string)
- */
+- if ((msec = timebuf.millitm - start_msec) < 0) {
+- msec += 1000;
+- timebuf.time -= 1;
++ if ((usec = timebuf.tv_usec - start_usec) < 0) {
++ usec += 1000000;
++ timebuf.tv_sec -= 1;
+ }
-- struct timeb timebuf;
-+ struct timeval timebuf;
- char loglevel[16];
- char *separator;
-
-- ftime (&timebuf);
-- start_sec = timebuf.time;
-- start_msec = timebuf.millitm;
-+ gettimeofday (&timebuf, NULL);
-+ start_sec = timebuf.tv_sec;
-+ start_usec = timebuf.tv_usec;
+- sec = timebuf.time - start_sec;
++ sec = timebuf.tv_sec - start_sec;
- /*
- * Split string into loglevel and optional cupslog string
+- fprintf(debug_file, "%8s: %03d.%03d %s", level2str(level), sec, msec,
++ fprintf(debug_file, "%8s: %03d.%06ld %s", level2str(level), sec, usec,
+ printbuf);
+ fflush(debug_file);
+ }
+@@ -234,12 +234,12 @@
+ * set debug level to level (string)
+ */
+
+- struct timeb timebuf;
++ struct timeval timebuf;
+ char loglevel[16];
+
+- ftime(&timebuf);
+- start_sec = timebuf.time;
+- start_msec = timebuf.millitm;
++ gettimeofday (&timebuf, NULL);
++ start_sec = timebuf.tv_sec;
++ start_usec = timebuf.tv_usec;
+
+ /*
+ * Set log level