]> granicus.if.org Git - file/commitdiff
patches from NetBSD for LP64 problems.
authorChristos Zoulas <christos@zoulas.com>
Mon, 5 Mar 2007 02:41:29 +0000 (02:41 +0000)
committerChristos Zoulas <christos@zoulas.com>
Mon, 5 Mar 2007 02:41:29 +0000 (02:41 +0000)
src/compress.c
src/print.c
src/softmagic.c

index 2c378e71737fe0ee4e023c32673f1ef85ad014eb..2ccbef6e86e054d77629ac358b56f85b5beb0ac3 100644 (file)
@@ -55,7 +55,7 @@
 
 
 #ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.50 2007/03/01 22:14:54 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.51 2007/03/05 02:41:29 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;
index 6b019eba41aec77d577249ec38b5d437df84bb7a..d1d1ec108e14c38c5769697b677f3e8d171d1c13 100644 (file)
@@ -41,7 +41,7 @@
 #include <time.h>
 
 #ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.58 2007/01/16 14:58:48 ljt Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.59 2007/03/05 02:41:29 christos 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);
index a6b1bacde7eac645746f78fa4d4239f8d2d88a35..f49cefc399e48f33f50608af740be5cebbf4f830 100644 (file)
@@ -38,7 +38,7 @@
 
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.95 2007/03/03 19:09:25 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.96 2007/03/05 02:41:29 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;