mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
burp/2.[12]: fix build with llvm22: use time_t instead of long for times
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
VERSION = 2.1.28
|
||||
REVISION = 4
|
||||
REVISION = 5
|
||||
|
||||
post-extract:
|
||||
sed -i 's,"/usr/sbin/%s","${TRUEPREFIX}/sbin/%s",' \
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
fix build with llvm22
|
||||
|
||||
error: incompatible pointer types passing 'long *' to parameter of type 'const time_t *' (aka 'const long long *') [-Wincompatible-pointer-types]
|
||||
|
||||
Index: src/server/timer.c
|
||||
--- src/server/timer.c.orig
|
||||
+++ src/server/timer.c
|
||||
@@ -117,7 +117,7 @@ static int check_interval(
|
||||
time_t time_now)
|
||||
{
|
||||
char *cp;
|
||||
- long min_time;
|
||||
+ time_t min_time;
|
||||
long seconds=0;
|
||||
char tstmp[64]="";
|
||||
char min_time_buf[64]="";
|
||||
@@ -0,0 +1,19 @@
|
||||
Index: src/server/timestamp.c
|
||||
--- src/server/timestamp.c.orig
|
||||
+++ src/server/timestamp.c
|
||||
@@ -65,7 +65,7 @@ int timestamp_get_new(uint64_t index,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-long timestamp_to_long(const char *buf)
|
||||
+time_t timestamp_to_long(const char *buf)
|
||||
{
|
||||
struct tm tm;
|
||||
const char *b=NULL;
|
||||
@@ -74,5 +74,5 @@ long timestamp_to_long(const char *buf)
|
||||
if(!strptime(b+1, DEFAULT_TIMESTAMP_FORMAT, &tm)
|
||||
&& !strptime(b+1, DEFAULT_TIMESTAMP_FORMAT_OLD, &tm))
|
||||
return 0;
|
||||
- return (long)mktime(&tm);
|
||||
+ return mktime(&tm);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
Index: src/server/timestamp.h
|
||||
--- src/server/timestamp.h.orig
|
||||
+++ src/server/timestamp.h
|
||||
@@ -7,7 +7,7 @@ extern int timestamp_read(const char *path, char buf[]
|
||||
extern int timestamp_write(const char *path, const char *tstmp);
|
||||
extern int timestamp_get_new(uint64_t index,
|
||||
char *buf, size_t s, char *bufforfile, size_t bs, const char *format);
|
||||
-extern long timestamp_to_long(const char *buf);
|
||||
+extern time_t timestamp_to_long(const char *buf);
|
||||
|
||||
#ifdef UTEST
|
||||
extern void timestamp_write_to_buf(char *buf, size_t s,
|
||||
@@ -1,5 +1,5 @@
|
||||
VERSION = 2.2.18
|
||||
REVISION = 2
|
||||
REVISION = 3
|
||||
|
||||
post-extract:
|
||||
sed -i 's,"/usr/sbin/%s","${TRUEPREFIX}/sbin/%s",' \
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
fix build with llvm22
|
||||
|
||||
error: incompatible pointer types passing 'long *' to parameter of type 'const time_t *' (aka 'const long long *') [-Wincompatible-pointer-types]
|
||||
|
||||
Index: src/server/timer.c
|
||||
--- src/server/timer.c.orig
|
||||
+++ src/server/timer.c
|
||||
@@ -145,7 +145,7 @@ static int check_interval(
|
||||
time_t time_now)
|
||||
{
|
||||
char *cp;
|
||||
- long min_time;
|
||||
+ time_t min_time;
|
||||
long seconds=0;
|
||||
char tstmp[64]="";
|
||||
char min_time_buf[64]="";
|
||||
@@ -0,0 +1,19 @@
|
||||
Index: src/server/timestamp.c
|
||||
--- src/server/timestamp.c.orig
|
||||
+++ src/server/timestamp.c
|
||||
@@ -65,7 +65,7 @@ int timestamp_get_new(uint64_t index,
|
||||
return 0;
|
||||
}
|
||||
|
||||
-long timestamp_to_long(const char *buf)
|
||||
+time_t timestamp_to_long(const char *buf)
|
||||
{
|
||||
struct tm tm;
|
||||
const char *b=NULL;
|
||||
@@ -76,5 +76,5 @@ long timestamp_to_long(const char *buf)
|
||||
return 0;
|
||||
// Unset dst so that mktime has to figure it out.
|
||||
tm.tm_isdst=-1;
|
||||
- return (long)mktime(&tm);
|
||||
+ return mktime(&tm);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
Index: src/server/timestamp.h
|
||||
--- src/server/timestamp.h.orig
|
||||
+++ src/server/timestamp.h
|
||||
@@ -7,7 +7,7 @@ extern int timestamp_read(const char *path, char buf[]
|
||||
extern int timestamp_write(const char *path, const char *tstmp);
|
||||
extern int timestamp_get_new(uint64_t index,
|
||||
char *buf, size_t s, char *bufforfile, size_t bs, const char *format);
|
||||
-extern long timestamp_to_long(const char *buf);
|
||||
+extern time_t timestamp_to_long(const char *buf);
|
||||
|
||||
#ifdef UTEST
|
||||
extern void timestamp_write_to_buf(char *buf, size_t s,
|
||||
Reference in New Issue
Block a user