Ver Fonte

Plan 9 from Bell Labs 2012-07-10

David du Colombier há 12 anos atrás
pai
commit
cb9f3b3a17
1 ficheiros alterados com 9 adições e 3 exclusões
  1. 9 3
      sys/src/cmd/cdfs/main.c

+ 9 - 3
sys/src/cmd/cdfs/main.c

@@ -340,6 +340,7 @@ static void
 readctl(Req *r)
 {
 	int i, isaudio;
+	ulong nwa;
 	char *p, *e, *ty;
 	char s[1024];
 	Msf *m;
@@ -375,9 +376,14 @@ readctl(Req *r)
 		ty = disctype(drive);
 		p = seprint(p, e, "%s", ty);
 		free(ty);
-		if (drive->mmctype != Mmcnone)
-			p = seprint(p, e, " next writable sector %lud",
-				getnwa(drive));
+		if (drive->mmctype != Mmcnone) {
+			nwa = getnwa(drive);
+			p = seprint(p, e, " next writable sector ");
+			if (nwa == ~0ul)
+				p = seprint(p, e, "none; disc full");
+			else
+				p = seprint(p, e, "%lud", nwa);
+		}
 		seprint(p, e, "\n");
 	}
 	readstr(r, s);