summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2007-03-05 02:41:29 +0000
committerChristos Zoulas <christos@zoulas.com>2007-03-05 02:41:29 +0000
commit847f4731831fb0f4da58479835127e8473fba452 (patch)
tree763b74ec4ac8caeea874790070488bea17accf29
parentea022b8c7c8f7cfb7f6a4667f12742b322732ef3 (diff)
downloadfile-git-847f4731831fb0f4da58479835127e8473fba452.tar.gz
patches from NetBSD for LP64 problems.
-rw-r--r--src/compress.c12
-rw-r--r--src/print.c8
-rw-r--r--src/softmagic.c4
3 files changed, 12 insertions, 12 deletions
diff --git a/src/compress.c b/src/compress.c
index e714d547..8d076c39 100644
--- a/src/compress.c
+++ b/src/compress.c
@@ -55,7 +55,7 @@
#ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.49 2007/02/05 16:46:40 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.50 2007/03/01 22:14:54 christos Exp $")
#endif
private struct {
@@ -170,12 +170,12 @@ sread(int fd, void *buf, size_t n, int canbepipe)
goto nocheck;
#ifdef FIONREAD
- if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1) || (t == 0)) {
+ if ((canbepipe && (ioctl(fd, FIONREAD, &t) == -1)) || (t == 0)) {
#ifdef FD_ZERO
for (cnt = 0;; cnt++) {
fd_set check;
struct timeval tout = {0, 100 * 1000};
- int rv;
+ int selrv;
FD_ZERO(&check);
FD_SET(fd, &check);
@@ -184,11 +184,11 @@ sread(int fd, void *buf, size_t n, int canbepipe)
* Avoid soft deadlock: do not read if there
* is nothing to read from sockets and pipes.
*/
- rv = select(fd + 1, &check, NULL, NULL, &tout);
- if (rv == -1) {
+ selrv = select(fd + 1, &check, NULL, NULL, &tout);
+ if (selrv == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
- } else if (rv == 0 && cnt >= 5) {
+ } else if (selrv == 0 && cnt >= 5) {
return 0;
} else
break;
diff --git a/src/print.c b/src/print.c
index 3502a1f7..f3045928 100644
--- a/src/print.c
+++ b/src/print.c
@@ -41,7 +41,7 @@
#include <time.h>
#ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.57 2007/01/12 17:38:28 christos Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.58 2007/01/16 14:58:48 ljt Exp $")
#endif /* lint */
#define SZOF(a) (sizeof(a) / sizeof(a[0]))
@@ -52,8 +52,8 @@ file_mdump(struct magic *m)
{
private const char optyp[] = { FILE_OPS };
- (void) fprintf(stderr, "[%zu", m->lineno);
- (void) fprintf(stderr, ">>>>>>>> %d" + 8 - (m->cont_level & 7),
+ (void) fprintf(stderr, "[%u", m->lineno);
+ (void) fprintf(stderr, ">>>>>>>> %u" + 8 - (m->cont_level & 7),
m->offset);
if (m->flag & INDIR) {
@@ -63,7 +63,7 @@ file_mdump(struct magic *m)
file_names[m->in_type] : "*bad*");
if (m->in_op & FILE_OPINVERSE)
(void) fputc('~', stderr);
- (void) fprintf(stderr, "%c%d),",
+ (void) fprintf(stderr, "%c%u),",
((m->in_op & FILE_OPS_MASK) < SZOF(optyp)) ?
optyp[m->in_op & FILE_OPS_MASK] : '?',
m->in_offset);
diff --git a/src/softmagic.c b/src/softmagic.c
index 45736f05..b6219c9f 100644
--- a/src/softmagic.c
+++ b/src/softmagic.c
@@ -38,7 +38,7 @@
#ifndef lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.94 2007/03/02 19:52:47 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.95 2007/03/03 19:09:25 christos Exp $")
#endif /* lint */
private int match(struct magic_set *, struct magic *, uint32_t,
@@ -336,7 +336,7 @@ private int32_t
mprint(struct magic_set *ms, struct magic *m)
{
uint64_t v;
- int32_t t = 0;
+ int64_t t = 0;
char buf[512];
union VALUETYPE *p = &ms->ms_value;