diff options
author | 2013-08-08 03:16:13 +0000 | |
---|---|---|
committer | 2013-08-08 03:16:13 +0000 | |
commit | 36ac2e2afede4094a8aa0762d21bb3b464cc7675 (patch) | |
tree | 03613b9315fdc25a2c6456d607bc1fac53f873bf | |
parent | Most network drivers include netinet/in_var.h, but apparently they (diff) | |
download | wireguard-openbsd-36ac2e2afede4094a8aa0762d21bb3b464cc7675.tar.xz wireguard-openbsd-36ac2e2afede4094a8aa0762d21bb3b464cc7675.zip |
Prep for big ino_t: cast to unsigned long long and format with %ll or %q
httpd correction and ok kettenis@
-rw-r--r-- | gnu/usr.bin/cvs/src/hardlink.c | 4 | ||||
-rw-r--r-- | gnu/usr.sbin/mkhybrid/src/tree.c | 4 | ||||
-rw-r--r-- | lib/libfuse/fuse_ops.c | 25 | ||||
-rw-r--r-- | usr.sbin/httpd/src/main/http_protocol.c | 6 | ||||
-rw-r--r-- | usr.sbin/lpr/lpr/lpr.c | 6 |
5 files changed, 23 insertions, 22 deletions
diff --git a/gnu/usr.bin/cvs/src/hardlink.c b/gnu/usr.bin/cvs/src/hardlink.c index 309d27f078d..245ce3d2e29 100644 --- a/gnu/usr.bin/cvs/src/hardlink.c +++ b/gnu/usr.bin/cvs/src/hardlink.c @@ -77,7 +77,7 @@ lookup_file_by_inode (filepath) error (1, errno, "cannot stat %s", file); } - sprintf (inodestr, "%lx", (unsigned long) sb.st_ino); + sprintf (inodestr, "%llx", (unsigned long long) sb.st_ino); /* Find out if this inode is already in the hardlist, adding a new entry to the list if not. */ @@ -193,7 +193,7 @@ list_linked_files_on_disk (file) inode, so it requires two bytes of text to represent each byte of the inode number. */ inodestr = (char *) xmalloc (2*sizeof(ino_t) + 1); - sprintf (inodestr, "%lx", (unsigned long) sb.st_ino); + sprintf (inodestr, "%llx", (unsigned long long) sb.st_ino); /* Make sure the files linked to this inode are sorted. */ n = findnode (hardlist, inodestr); diff --git a/gnu/usr.sbin/mkhybrid/src/tree.c b/gnu/usr.sbin/mkhybrid/src/tree.c index 39882c344a1..071bbdb405b 100644 --- a/gnu/usr.sbin/mkhybrid/src/tree.c +++ b/gnu/usr.sbin/mkhybrid/src/tree.c @@ -1184,9 +1184,9 @@ FDECL3(insert_file_entry,struct directory *, this_dir, /* NON-HFS change - print just a warning *if* this ever happens */ fprintf(stderr,"Warning: Directory loop (%s)\n", whole_path); #else - fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n", + fprintf(stderr,"Directory loop - fatal goof (%s %lx %llu).\n", whole_path, (unsigned long) statbuf.st_dev, - (unsigned long) STAT_INODE(statbuf)); + (unsigned long long) STAT_INODE(statbuf)); exit(1); #endif } diff --git a/lib/libfuse/fuse_ops.c b/lib/libfuse/fuse_ops.c index 7b7dd1c0b0a..868994b1392 100644 --- a/lib/libfuse/fuse_ops.c +++ b/lib/libfuse/fuse_ops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_ops.c,v 1.5 2013/06/14 20:56:11 syl Exp $ */ +/* $OpenBSD: fuse_ops.c,v 1.6 2013/08/08 03:16:13 guenther Exp $ */ /* * Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -23,7 +23,8 @@ #include "debug.h" #define CHECK_OPT(opname) DPRINTF("Opcode:\t%s\n", #opname); \ - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); \ + DPRINTF("Inode:\t%llu\n", \ + (unsigned long long)fbuf->fb_ino); \ if (!f->op.opname) { \ fbuf->fb_err = -ENOSYS; \ fbuf->fb_len = 0; \ @@ -102,7 +103,7 @@ ifuse_ops_getattr(struct fuse *f, struct fusebuf *fbuf) char *realname; DPRINTF("Opcode:\tgetattr\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); bzero(&st, sizeof(st)); fbuf->fb_len = FUSEFDSIZE; @@ -149,7 +150,7 @@ ifuse_ops_open(struct fuse *f, struct fusebuf *fbuf) char *realname; DPRINTF("Opcode:\topen\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); CHECK_OPT(open); @@ -179,7 +180,7 @@ ifuse_ops_opendir(struct fuse *f, struct fusebuf *fbuf) char *realname; DPRINTF("Opcode:\topendir\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); memset(&ffi, 0, sizeof(ffi)); ffi.flags = fbuf->fb_io_flags; @@ -291,7 +292,7 @@ ifuse_ops_readdir(struct fuse *f, struct fusebuf *fbuf) uint32_t startsave; DPRINTF("Opcode:\treaddir\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); DPRINTF("Offset:\t%llu\n", fbuf->fb_io_off); DPRINTF("Size:\t%lu\n", fbuf->fb_io_len); @@ -350,7 +351,7 @@ ifuse_ops_releasedir(struct fuse *f, struct fusebuf *fbuf) char *realname; DPRINTF("Opcode:\treleasedir\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); bzero(&ffi, sizeof(ffi)); ffi.fh = fbuf->fb_io_fd; @@ -408,7 +409,7 @@ ifuse_ops_lookup(struct fuse *f, struct fusebuf *fbuf) char *realname; DPRINTF("Opcode:\tlookup\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); DPRINTF("For file %s\n", fbuf->fb_dat); vn = get_vn_by_name_and_parent(f, fbuf->fb_dat, fbuf->fb_ino); @@ -423,7 +424,7 @@ ifuse_ops_lookup(struct fuse *f, struct fusebuf *fbuf) set_vn(f, vn); /*XXX*/ } - DPRINTF("new ino %i\n", vn->ino); + DPRINTF("new ino %llu\n", (unsigned long long)vn->ino); fbuf->fb_len = FUSEFDSIZE; realname = build_realname(f, vn->ino); @@ -607,7 +608,7 @@ ifuse_ops_readlink(struct fuse *f, struct fusebuf *fbuf) int len, ret; DPRINTF("Opcode:\treadlink\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); vn = tree_get(&f->vnode_tree, fbuf->fb_ino); @@ -716,7 +717,7 @@ ifuse_ops_setattr(struct fuse *f, struct fusebuf *fbuf) gid_t gid; DPRINTF("Opcode:\tsetattr\n"); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); vn = tree_get(&f->vnode_tree, fbuf->fb_ino); realname = build_realname(f, vn->ino); @@ -911,7 +912,7 @@ ifuse_exec_opcode(struct fuse *f, struct fusebuf *fbuf) break; default: DPRINTF("Opcode:\t%i not supported\n", fbuf->fb_type); - DPRINTF("Inode:\t%i\n", fbuf->fb_ino); + DPRINTF("Inode:\t%llu\n", (unsigned long long)fbuf->fb_ino); fbuf->fb_err = -ENOSYS; fbuf->fb_len = 0; diff --git a/usr.sbin/httpd/src/main/http_protocol.c b/usr.sbin/httpd/src/main/http_protocol.c index 2ddd8c997a5..e26c60ab883 100644 --- a/usr.sbin/httpd/src/main/http_protocol.c +++ b/usr.sbin/httpd/src/main/http_protocol.c @@ -1,4 +1,4 @@ -/* $OpenBSD: http_protocol.c,v 1.37 2010/02/25 07:49:53 pyr Exp $ */ +/* $OpenBSD: http_protocol.c,v 1.38 2013/08/08 03:16:13 guenther Exp $ */ /* ==================================================================== * The Apache Software License, Version 1.1 @@ -681,8 +681,8 @@ API_EXPORT(char *) ap_make_etag_orig(request_rec *r, int force_weak) components = ap_make_array(r->pool, 4, sizeof(char *)); if (etag_bits & ETAG_INODE) { ent = (char **) ap_push_array(components); - *ent = ap_psprintf(r->pool, "%lx", - (unsigned long) r->finfo.st_ino); + *ent = ap_psprintf(r->pool, "%qx", + (unsigned long long) r->finfo.st_ino); } if (etag_bits & ETAG_SIZE) { ent = (char **) ap_push_array(components); diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c index 8533853dbee..d8f31192fe2 100644 --- a/usr.sbin/lpr/lpr/lpr.c +++ b/usr.sbin/lpr/lpr/lpr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpr.c,v 1.43 2013/02/15 08:28:08 mpi Exp $ */ +/* $OpenBSD: lpr.c,v 1.44 2013/08/08 03:16:14 guenther Exp $ */ /* $NetBSD: lpr.c,v 1.19 2000/10/11 20:23:52 is Exp $ */ /* @@ -328,8 +328,8 @@ main(int argc, char **argv) continue; /* file unreasonable */ if (sflag && (cp = linked(arg)) != NULL) { - (void)snprintf(buf, sizeof(buf), "%d %d", - statb.st_dev, statb.st_ino); + (void)snprintf(buf, sizeof(buf), "%d %llu", + statb.st_dev, (unsigned long long)statb.st_ino); card('S', buf); if (format == 'p') card('T', title ? title : arg); |