diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 | 
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 1999-01-21 00:55:32 +0000 | 
| commit | 76b5366091f76c9bc73570149ef5055648fc2c39 (patch) | |
| tree | 590d020e0f2a5bea6e09d66d951a674443b21d67 /sbin/tunefs/tunefs.c | |
| parent | 4b4d01da6f07f7754ff6a6e4f5223e9f0984d1a6 (diff) | |
Diffstat (limited to 'sbin/tunefs/tunefs.c')
| -rw-r--r-- | sbin/tunefs/tunefs.c | 51 | 
1 files changed, 4 insertions, 47 deletions
| diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c index 8a32cb189d057..682c6e2fc4f32 100644 --- a/sbin/tunefs/tunefs.c +++ b/sbin/tunefs/tunefs.c @@ -42,18 +42,16 @@ static const char copyright[] =  static char sccsid[] = "@(#)tunefs.c	8.2 (Berkeley) 4/19/94";  #endif  static const char rcsid[] = -	"$Id: tunefs.c,v 1.6 1998/08/03 06:41:20 charnier Exp $"; +	"$Id$";  #endif /* not lint */  /*   * tunefs: change layout parameters to an existing file system.   */  #include <sys/param.h> -#include <sys/mount.h>  #include <sys/stat.h>  #include <ufs/ffs/fs.h> -#include <ufs/ufs/ufsmount.h>  #include <err.h>  #include <fcntl.h> @@ -61,7 +59,6 @@ static const char rcsid[] =  #include <paths.h>  #include <stdio.h>  #include <stdlib.h> -#include <string.h>  #include <unistd.h>  /* the optimization warning string template */ @@ -81,7 +78,6 @@ int bread(daddr_t, char *, int);  void getsb(struct fs *, char *);  void usage __P((void));  void printfs __P((void)); -char *rawname __P((char *, char *));  int  main(argc, argv) @@ -91,27 +87,17 @@ main(argc, argv)  	char *cp, *special, *name, *action;  	struct stat st;  	int i; -	int Aflag = 0, active = 0; +	int Aflag = 0;  	struct fstab *fs;  	char *chg[2], device[MAXPATHLEN]; -	struct ufs_args args; -	struct statfs stfs;  	argc--, argv++;  	if (argc < 2)  		usage();  	special = argv[argc - 1];  	fs = getfsfile(special); -	if (fs) { -		if (statfs(special, &stfs) == 0) { -		    	if ((stfs.f_flags & MNT_RDONLY) == 0) { -				errx(1, "cannot work on read-write mounted file system"); -			} -			active = 1; -			special = rawname(fs->fs_spec, device); -		} else -			special = fs->fs_spec; -	} +	if (fs) +		special = fs->fs_spec;  again:  	if (stat(special, &st) < 0) {  		if (*special != '/') { @@ -259,13 +245,6 @@ again:  			bwrite(fsbtodb(&sblock, cgsblock(&sblock, i)),  			    (char *)&sblock, SBSIZE);  	close(fi); -	if (active) { -		bzero(&args, sizeof(args)); -		if (mount("ufs", fs->fs_file, -		    stfs.f_flags | MNT_UPDATE | MNT_RELOAD, &args) < 0) -			err(9, "%s: reload", special); -		warnx("file system reloaded"); -	}  	exit(0);  } @@ -348,25 +327,3 @@ bread(bno, buf, cnt)  	}  	return (0);  } - -char * -rawname(special, pathbuf) -	char *special; -	char *pathbuf; -{ -	char *p; -	int n; - -	p = strrchr(special, '/'); -	if (p) { -		n = ++p - special; -		bcopy(special, pathbuf, n); -	} else { -		strcpy(pathbuf, _PATH_DEV); -		n = strlen(pathbuf); -		p = special; -	} -	pathbuf[n++] = 'r'; -	strcpy(pathbuf + n, p); -	return pathbuf; -} | 
