- fix with gcc2
ok espie@
This commit is contained in:
parent
585ecac2e7
commit
3dc4580465
17
devel/libmagic/patches/patch-src_cdf_c
Normal file
17
devel/libmagic/patches/patch-src_cdf_c
Normal file
@ -0,0 +1,17 @@
|
||||
$OpenBSD: patch-src_cdf_c,v 1.1 2010/08/05 12:42:24 jasper Exp $
|
||||
|
||||
Fix build with gcc2.
|
||||
|
||||
--- src/cdf.c.orig Thu Aug 5 12:56:49 2010
|
||||
+++ src/cdf.c Thu Aug 5 12:56:53 2010
|
||||
@@ -230,8 +230,9 @@ cdf_unpack_dir(cdf_directory_t *d, char *buf)
|
||||
int
|
||||
cdf_read_header(int fd, cdf_header_t *h)
|
||||
{
|
||||
- (void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
|
||||
char buf[512];
|
||||
+
|
||||
+ (void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
|
||||
if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1)
|
||||
return -1;
|
||||
if (read(fd, buf, sizeof(buf)) != sizeof(buf))
|
23
devel/libmagic/patches/patch-src_cdf_time_c
Normal file
23
devel/libmagic/patches/patch-src_cdf_time_c
Normal file
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-src_cdf_time_c,v 1.1 2010/08/05 12:42:24 jasper Exp $
|
||||
|
||||
Fix build with gcc2.
|
||||
|
||||
--- src/cdf_time.c.orig Thu Aug 5 05:33:56 2010
|
||||
+++ src/cdf_time.c Thu Aug 5 05:33:57 2010
|
||||
@@ -102,6 +102,7 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_tim
|
||||
#ifdef HAVE_STRUCT_TM_TM_ZONE
|
||||
static char UTC[] = "UTC";
|
||||
#endif
|
||||
+ int rdays;
|
||||
|
||||
/* Unit is 100's of nanoseconds */
|
||||
ts->tv_nsec = (t % CDF_TIME_PREC) * 100;
|
||||
@@ -119,7 +120,7 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_tim
|
||||
// XXX: Approx
|
||||
tm.tm_year = CDF_BASE_YEAR + (t / 365);
|
||||
|
||||
- int rdays = cdf_getdays(tm.tm_year);
|
||||
+ rdays = cdf_getdays(tm.tm_year);
|
||||
t -= rdays;
|
||||
tm.tm_mday = cdf_getday(tm.tm_year, t);
|
||||
tm.tm_mon = cdf_getmonth(tm.tm_year, t);
|
Loading…
Reference in New Issue
Block a user