Browse Source

Another round of %u modifier

This fixes tar, fossil and probably some other.
All source reviewed. I hope this will be last fix about this.

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 7 years ago
parent
commit
7ce394f35d

+ 2 - 2
sys/src/cmd/disk/mkext.c

@@ -104,7 +104,7 @@ main(int argc, char **argv)
 			mkdirs(name, namep);
 		}
 		if(hflag){
-			Bprint(&bout, "%q %luo %q %q %lu %llu\n",
+			Bprint(&bout, "%q %lo %q %q %lu %llu\n",
 				name, mode, uid, gid, mtime, bytes);
 			if(bytes)
 				seekpast(bytes);
@@ -172,7 +172,7 @@ mkdir(char *name, uint32_t mode, uint32_t mtime, char *uid,
 		rerrstr(olderr, sizeof(olderr));
 		if((d = dirstat(name)) == nil || !(d->mode & DMDIR)){
 			free(d);
-			warn("can't make directory %q, mode %luo: %s", name, mode, olderr);
+			warn("can't make directory %q, mode %lo: %s", name, mode, olderr);
 			return;
 		}
 		free(d);

+ 1 - 1
sys/src/cmd/disk/mkfs.c

@@ -483,7 +483,7 @@ mkdir(Dir *d)
 void
 arch(Dir *d)
 {
-	Bprint(&bout, "%q %luo %q %q %lu %lld\n",
+	Bprint(&bout, "%q %lo %q %q %lu %lld\n",
 		newfile, d->mode, d->uid, d->gid, d->mtime, d->length);
 }
 

+ 1 - 1
sys/src/cmd/fossil/9fsys.c

@@ -248,7 +248,7 @@ fsysModeString(uint32_t mode, char *buf)
 	for(i=0; modebits[i]; i++)
 		if(mode & modebits[i])
 			*p++ = modechars[i];
-	sprint(p, "%luo", mode&0777);
+	sprint(p, "%lo", mode&0777);
 	return buf;
 }
 

+ 1 - 1
sys/src/cmd/fossil/flfmt9660.c

@@ -540,7 +540,7 @@ iso9660copyfile(Fs *fs, File *dir, Cdir *c)
 	d.mtime = getcdate(c->date);
 	d.atime = d.mtime;
 
-if(d.mode&DMDIR)	print("%*scopy %s %s %s %luo\n", ind*2, "", d.name, d.uid, d.gid, d.mode);
+if(d.mode&DMDIR)	print("%*scopy %s %s %s %lo\n", ind*2, "", d.name, d.uid, d.gid, d.mode);
 
 	mode = d.mode&0777;
 	if(d.mode&DMDIR)

+ 1 - 1
sys/src/cmd/fossil/view.c

@@ -731,7 +731,7 @@ initxdirentry(MetaEntry *me)
 		"qid=%#llx\n"
 		"uid=%s gid=%s mid=%s\n"
 		"mtime=%lu mcount=%lu ctime=%lu atime=%lu\n"
-		"mode=%luo\n"
+		"mode=%lo\n"
 		"plan9 %d p9path %#llx p9version %lu\n"
 		"qidSpace %d offset %#llx max %#llx",
 		dir.qid,

+ 1 - 1
sys/src/cmd/ssh1/scp.c

@@ -592,7 +592,7 @@ send(char *file)
 			goto Return;
 	}
 
-	fprint(remotefd1, "C%.4luo %lld %s\n", d->mode&0777, d->length, lastelem(file));
+	fprint(remotefd1, "C%.4lo %lld %s\n", d->mode&0777, d->length, lastelem(file));
 	if(getresponse() < 0)
 		goto Return;
 

+ 1 - 1
sys/src/cmd/syscall/syscall.c

@@ -161,7 +161,7 @@ main(int argc, char *argv[])
 				else{
 					print("[%s] ", d.muid);
 					print("(%.16llux %lu %.2x) ", d.qid.path, d.qid.vers, d.qid.type);
-					print("%M (%luo) ", d.mode, d.mode);
+					print("%M (%lo) ", d.mode, d.mode);
 					print("%c %d ", d.type, d.dev);
 					print("%s %s ", d.uid, d.gid);
 					print("%lld ", d.length);

+ 3 - 3
sys/src/cmd/tar.c

@@ -746,8 +746,8 @@ mkhdr(Hdr *hp, Dir *dir, char *file)
 		putbe((unsigned char *)hp->size+1, dir->length, sizeof hp->size - 2);
 		hp->size[sizeof hp->size - 1] = ' ';
 	} else
-		sprint(hp->size, "%11lluo ", dir->length);
-	sprint(hp->mtime, "%11luo ", dir->mtime);
+		sprint(hp->size, "%11llo ", dir->length);
+	sprint(hp->mtime, "%11lo ", dir->mtime);
 	hp->linkflag = (dir->mode&DMDIR? LF_DIR: LF_PLAIN1);
 	r = putfullname(hp, file);
 	if (posix) {
@@ -756,7 +756,7 @@ mkhdr(Hdr *hp, Dir *dir, char *file)
 		strncpy(hp->uname, dir->uid, sizeof hp->uname);
 		strncpy(hp->gname, dir->gid, sizeof hp->gname);
 	}
-	sprint(hp->chksum, "%6luo", chksum(hp));
+	sprint(hp->chksum, "%6lo", chksum(hp));
 	return r;
 }
 

+ 4 - 4
sys/src/cmd/xd.c

@@ -54,8 +54,8 @@ fmtfn *fmt[4] = {
 char *dfmt[4][3] = {
 	" %.3o",	" %.3u",	" %.2x",
 	" %.6o",	" %.5u",	" %.4x",
-	" %.11luo",	" %.10lu",	" %.8lx",
-	" %.22lluo",	" %.20llu",	" %.16llx",
+	" %.11lo",	" %.10lu",	" %.8lx",
+	" %.22llo",	" %.20llu",	" %.16llx",
 };
 
 char *cfmt[3][3] = {
@@ -69,8 +69,8 @@ char *rfmt[1][1] = {
 };
 
 char *afmt[2][3] = {
-	"%.7luo ",	"%.7lu ",	"%.7lx ",
-	"%7luo ",	"%7lu ",	"%7lx ",
+	"%.7lo ",	"%.7lu ",	"%.7lx ",
+	"%7lo ",	"%7lu ",	"%7lx ",
 };
 
 Biobuf	bin;

+ 1 - 1
sys/src/libc/9sys/fcallfmt.c

@@ -189,7 +189,7 @@ fdirconv(char *buf, char *e, Dir *d)
 	char tmp[16];
 
 	seprint(buf, e, "'%s' '%s' '%s' '%s' "
-		"q " QIDFMT " m %#luo "
+		"q " QIDFMT " m %#lo "
 		"at %ld mt %ld l %lld "
 		"t %d d %d",
 			d->name, d->uid, d->gid, d->muid,

+ 1 - 1
sys/src/libventi/file.c

@@ -58,7 +58,7 @@ vtfilealloc(VtCache *c, VtBlock *b, VtFile *p, uint32_t offset, int mode)
 		epb = p->dsize / VtEntrySize;
 
 	if(b->type != VtDirType){
-		werrstr("bad block type %#uo", b->type);
+		werrstr("bad block type %#o", b->type);
 		return nil;
 	}