]> 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 e714d54764861c1dbf4e1105cd1e9306ba7ae19c..8d076c394219e9aa1820823494b17241d8a19e7c 100644 (file)
@@ -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;
index 3502a1f7a58a315c4304ea819f3aa637ea478fea..f30459285caea295490e8524762ab363f828b9f9 100644 (file)
@@ -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);
index 45736f057440b098463ad98483abbe5817db769d..b6219c9fab93e2132ea9898609b6688f1f6e7962 100644 (file)
@@ -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;