NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/44490: kernel doesn't build with -DLOCKF_DEBUG



>Number:         44490
>Category:       kern
>Synopsis:       kernel doesn't build with -DLOCKF_DEBUG
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 30 11:40:00 +0000 2011
>Originator:     Alexander Nasonov
>Release:        NetBSD 5.99.34 amd64
>Organization:
home sweet home
>Environment:
NetBSD 5.99.34 amd64
>Description:
Gcc doesn't like %qx in printf.
>How-To-Repeat:
Add "options LOCKF_DEBUG" to a config file.
>Fix:
Index: sys/kern/vfs_lockf.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_lockf.c,v
retrieving revision 1.72
diff -u -u -r1.72 vfs_lockf.c
--- sys/kern/vfs_lockf.c        5 Aug 2009 19:39:50 -0000       1.72
+++ sys/kern/vfs_lockf.c        30 Jan 2011 01:55:29 -0000
@@ -138,11 +138,11 @@
                printf("proc %d", ((struct proc *)lock->lf_id)->p_pid);
        else
                printf("file %p", (struct file *)lock->lf_id);
-       printf(" %s, start %qx, end %qx",
+       printf(" %s, start %jd, end %jd",
                lock->lf_type == F_RDLCK ? "shared" :
                lock->lf_type == F_WRLCK ? "exclusive" :
                lock->lf_type == F_UNLCK ? "unlock" :
-               "unknown", lock->lf_start, lock->lf_end);
+               "unknown", (intmax_t)lock->lf_start, (intmax_t)lock->lf_end);
        if (TAILQ_FIRST(&lock->lf_blkhd))
                printf(" block %p\n", TAILQ_FIRST(&lock->lf_blkhd));
        else
@@ -161,22 +161,22 @@
                        printf("proc %d", ((struct proc *)lf->lf_id)->p_pid);
                else
                        printf("file %p", (struct file *)lf->lf_id);
-               printf(", %s, start %qx, end %qx",
+               printf(", %s, start %jd, end %jd",
                        lf->lf_type == F_RDLCK ? "shared" :
                        lf->lf_type == F_WRLCK ? "exclusive" :
                        lf->lf_type == F_UNLCK ? "unlock" :
-                       "unknown", lf->lf_start, lf->lf_end);
+                       "unknown", (intmax_t)lf->lf_start, 
(intmax_t)lf->lf_end);
                TAILQ_FOREACH(blk, &lf->lf_blkhd, lf_block) {
                        if (blk->lf_flags & F_POSIX)
                                printf("; proc %d",
                                    ((struct proc *)blk->lf_id)->p_pid);
                        else
                                printf("; file %p", (struct file *)blk->lf_id);
-                       printf(", %s, start %qx, end %qx",
+                       printf(", %s, start %jd, end %jd",
                                blk->lf_type == F_RDLCK ? "shared" :
                                blk->lf_type == F_WRLCK ? "exclusive" :
                                blk->lf_type == F_UNLCK ? "unlock" :
-                               "unknown", blk->lf_start, blk->lf_end);
+                               "unknown", (intmax_t)blk->lf_start, 
(intmax_t)blk->lf_end);
                        if (TAILQ_FIRST(&blk->lf_blkhd))
                                 panic("lf_printlist: bad list");
                }



Home | Main Index | Thread Index | Old Index