Source-Changes-HG archive

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

[src/trunk]: src/sbin/newfs_msdos after determining the size of a file being ...



details:   https://anonhg.NetBSD.org/src/rev/bdb360b1f622
branches:  trunk
changeset: 474907:bdb360b1f622
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon Jul 26 00:28:57 1999 +0000

description:
after determining the size of a file being used as a msdosfs, seek back to
its start so subsequent writes go to the right places.

diffstat:

 sbin/newfs_msdos/newfs_msdos.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r c54aaaddae70 -r bdb360b1f622 sbin/newfs_msdos/newfs_msdos.c
--- a/sbin/newfs_msdos/newfs_msdos.c    Mon Jul 26 00:14:27 1999 +0000
+++ b/sbin/newfs_msdos/newfs_msdos.c    Mon Jul 26 00:28:57 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: newfs_msdos.c,v 1.3 1997/10/17 17:47:41 drochner Exp $ */
+/*     $NetBSD: newfs_msdos.c,v 1.4 1999/07/26 00:28:57 cgd Exp $      */
 
 /*
  * Copyright (c) 1997 Christos Zoulas
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: newfs_msdos.c,v 1.3 1997/10/17 17:47:41 drochner Exp $");
+__RCSID("$NetBSD: newfs_msdos.c,v 1.4 1999/07/26 00:28:57 cgd Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -153,6 +153,7 @@
                    (offs = lseek(fd, (off_t) 0, SEEK_CUR)) == -1)
                        /* Hmm, hmm.  Hard luck. */
                        return 0;
+               (void) lseek(fd, (off_t) 0, SEEK_SET);
                return (size_t) (offs / 1024);
        } else if (S_ISCHR(sb.st_mode) || S_ISBLK(sb.st_mode)) {
                char            b[512];



Home | Main Index | Thread Index | Old Index