Date: Fri, 30 Sep 2005 21:55:47 GMT From: Scott Long <scottl@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 84582 for review Message-ID: <200509302155.j8ULtlKQ089556@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=84582 Change 84582 by scottl@scottl-junior on 2005/09/30 21:55:43 Correct some faulty logic. Affected files ... .. //depot/projects/soc2005/ufsj/src/sbin/tunefs/tunefs.c#6 edit Differences ... ==== //depot/projects/soc2005/ufsj/src/sbin/tunefs/tunefs.c#6 (text+ko) ==== @@ -75,6 +75,11 @@ void usage(void); void printfs(void); +/* + * Create a valid journal file. + * XXX This is just a hack at the moment. The real version will generate the + * appropriate metadata instead of relying on the FS to do it. + */ ino_t create_journal(void) { @@ -88,15 +93,12 @@ args.fspec = (void *)disk.d_name; if (mount("ufs", "/mnt", 0, &args) < 0) err(1, "%s", disk.d_name); - if (stat("/mnt/.jounal", &sb) == 0) { - unlink("/mnt/.journal"); - } if (statfs("/mnt", &fs) < 0) err(1, "%s", disk.d_name); jblocks = fs.f_blocks * .01; - fd = open("/mnt/.journal", O_RDWR | O_CREAT); + fd = open("/mnt/.journal", O_RDWR | O_CREAT | O_TRUNC); if (fd < 0) err(1, "%s", disk.d_name);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509302155.j8ULtlKQ089556>