Lines Matching refs:fname
260 const char *fname, *dtype, *bname; in newfs_msdos_main() local
360 fname = *argv++; in newfs_msdos_main()
361 if (!opt_create && !strchr(fname, '/')) { in newfs_msdos_main()
362 snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname); in newfs_msdos_main()
363 if (!(fname = strdup(buf))) in newfs_msdos_main()
376 fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644); in newfs_msdos_main()
378 errx(1, "failed to create %s", fname); in newfs_msdos_main()
381 } else if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1) in newfs_msdos_main()
382 err(1, "%s", fname); in newfs_msdos_main()
384 err(1, "%s", fname); in newfs_msdos_main()
387 warnx("warning, %s is not a regular file", fname); in newfs_msdos_main()
390 warnx("warning, %s is not a character device", fname); in newfs_msdos_main()
393 check_mounted(fname, sb.st_mode); in newfs_msdos_main()
416 getdiskinfo(fd, fname, dtype, oflag, &bpb); in newfs_msdos_main()
622 fname, cls * bpb.spc, cls * bpb.spc == 1 ? "" : "s", cls, fat, in newfs_msdos_main()
738 err(1, "%s", fname); in newfs_msdos_main()
740 errx(1, "%s: can't write sector %u", fname, lsn); in newfs_msdos_main()
752 static void check_mounted(const char *fname, mode_t mode) in check_mounted() argument
765 s1 = fname; in check_mounted()
768 r = S_ISCHR(mode) && s1 != fname && *s1 == 'r'; in check_mounted()
774 errx(1, "%s is mounted on %s", fname, mp->f_mntonname); in check_mounted()
798 static void getdiskinfo(int fd, const char *fname, const char *dtype, in getdiskinfo() argument
809 ckgeom(fname, bpb->bps, "bytes/sector"); in getdiskinfo()
840 ckgeom(fname, bpb->spt, "sectors/track"); in getdiskinfo()
843 ckgeom(fname, bpb->hds, "drive heads"); in getdiskinfo()
848 static void getdiskinfo(int fd, const char *fname, const char *dtype, in getdiskinfo() argument
914 bpb->bps = ckgeom(fname, lp->d_secsize, "bytes/sector"); in getdiskinfo()
916 bpb->spt = ckgeom(fname, lp->d_nsectors, "sectors/track"); in getdiskinfo()
918 bpb->hds = ckgeom(fname, lp->d_ntracks, "drive heads"); in getdiskinfo()
956 static u_int ckgeom(const char *fname, u_int val, const char *msg) in ckgeom() argument
959 errx(1, "%s: no default %s", fname, msg); in ckgeom()
961 errx(1, "%s: illegal %s %d", fname, msg, val); in ckgeom()