Commit Graph

76 Commits

Author SHA1 Message Date
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
wiz ad6a1e0149 Fix grammar 2022-01-22 09:59:26 +00:00
christos 4efd5405d6 make umount NAME= work 2020-04-23 04:21:13 +00:00
mrg de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
abhinav d482d5b4c5 s/filesystem/file system/ 2017-06-07 15:24:50 +00:00
sevan 38077dbda0 umount appeared in V1
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1/man/man1/umount.1

Amend HISTORY.
Bump date.
2016-09-12 06:34:08 +00:00
dholland ece47fa390 Don't assume that getaddrinfo sets the result pointer to null when it
fails. (In fact it probably doesn't...)
2016-06-26 04:01:30 +00:00
dholland a4b908377f Document external unmount programs. PR 698. Bump date. 2016-06-26 03:59:11 +00:00
dholland 383d022f18 Fix previous to avoid using an uninitialized pointer when using -R (raw). 2016-06-26 03:51:28 +00:00
dholland 4cc121caa5 If an external unmount program of the form "umount_TYPE" exists
(e.g. umount_ffs, umount_nfs, etc.) exec it instead of calling
unmount(2).

Closes PR 698.

Note that the original plan for the PR also involved adding a generic
facility to store an alternate FS type name in the kernel to use when
unmounting. This was intended to support filesystems implemented as
loopback nfs servers, where the visible mount would be of type "nfs"
pointing at localhost; in that case one would want to be able to
provide an additional string in order to run an unmount program that
would both remove that mount and also shut down the loopback nfs
server daemon.

However, in the 21+ years since the PR was filed, loopback nfs servers
have gone out of favor (for good reasons) so I don't see any need to
worry about this case at present, especially since the PR has been
hanging around this long anyway. (If anyone still has a loopback nfs
server that they want to use a custom unmount program with, file a new
PR and assign it to me and I'll deal with it specifically in the nfs
mount args structure, which unmount already knows how to retrieve and
examine.)

It is my understanding that filesystems implemented with fuse (which
has displaced the loopback nfs server model) can already set the FS
type field so no further work is needed to allow them to use a custom
unmount program. If this is not the case, please let me know and I'll
attend to it.

There is no longer any need that I see to provide a general facility
for storing an alternate filesystem type name.

(One might also ask whether there's any real need for this
functionality at all any more; this is a fair question, but (a) the
change is small and (b) there are certainly cases when doing FS
research where you want a custom unmount program; been there & done
that.)
2016-06-26 03:40:39 +00:00
dholland 75cbf5e12c When SMALL, if realpath() fails, warn() using the failing path instead
of the buffer realpath has declined to write anything into.
2016-06-26 03:05:52 +00:00
manu 123566befd Remove useless and harmful sync(2) call in umount(8)
Remove sync(2) call before unmount(2) in umount(8). This sync(2) is useless
since unmount(2) will perform a VFS_SYNC anyway.

But moreover, this sync(2) may be harmful, as there are some situation where
it cannot return (unreachable NFS server, for instance), causing umount -f
to be uneffective.
2015-06-27 08:29:56 +00:00
christos b8a7bdb609 move proto to small 2013-07-02 01:39:17 +00:00
christos 958c0aac6e Instead of borrowing the mount code to get the nfs arguments, just use
the system call directly. It is shorter and works...
2013-07-01 15:16:33 +00:00
christos 3a4a09ca06 one copy of the name is enough, and free it. 2013-06-29 23:06:29 +00:00
christos da960e0858 Use the protocol we mounted the filesystem with instead of always udp.
(untested, but should fail back to udp).
2013-06-29 22:53:04 +00:00
mjf 3d68316951 Add an exmaple of unmounting all file systems apart from NFS and MFS
e.g,

	umount -a -t nonfs,mfs

This makes it clear that the "no prefix" only needs to be on the first
file-system argument to -t. The mount(8) man page has a clear example
of this but for some reason umount(8) was missing one.
2009-05-17 14:09:15 +00:00
pooka 99fed7264c Refactor mount utilities to provide a mount_fs_parseargs() routine.
Use this routine both in mount_fs and rump_fs to provide equivalent
command line parameters and therefore usage interchangeability.
While doing this, combine some common mountgoop to mountprog.h
2008-08-05 20:57:45 +00:00
lukem 6543a91fea Remove the \n and tabs from the __COPYRIGHT() strings.
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos 27e0d2b78b kill MFSNAMELEN 2007-07-17 20:17:52 +00:00
pooka 704e075311 Make all mount(2) return value error checks against -1. Some file
systems just checked != 0, breaking MNT_GETARGS.  Others worked with < 0,
but make them check against -1 too for consistency.  And sprinkle some
stylish line wrapping where appropriate.
2007-07-16 17:06:52 +00:00
dsl 09d4a5d5c8 Izumi Tsutsui pointed out that we don't need vfslist.c (from ../mount)
if we are defining SMALL.
2006-01-21 11:59:53 +00:00
dsl 3dd504cd3b Set -DSMALL if SMALLPROG defined - ie building install ramdisk images.
Removes the code that uses rpc to query remote systems about nfs mounts.
The last references to the xdr routines escape - saving 64k+
2006-01-21 10:34:32 +00:00
mjl 0a7b52fa50 Typo fix (to umount is not yet a verb). Via OpenBSD bugs mailing list. 2005-12-30 10:29:56 +00:00
christos 2c6eadc9ce Move WARNS=3 to the Makefile.inc, and add a little const to the remaining
programs that did not compile before.
2005-06-27 01:00:04 +00:00
erh a432762d9a Fix PR#3205 for the -a case: when the list of mount points comes from the
kernel, always use "raw" mode (-R option) so unmounting odd mount points works.
Also, fix available options in SMALL mode to include -R, not -r.
2005-01-31 01:19:30 +00:00
xtraeme 76500fc2f9 WARNS=2 is the default defined in sbin/Makefile.inc. (thanks wiz) 2005-01-20 16:39:22 +00:00
xtraeme 8b90e8f10f Remove main() prototype; WARNS=2 2005-01-19 20:43:06 +00:00
chs a3b206f61a pass data to a function via an argument instead of via a global variable.
this avoids a name collision with libcurses functions when both are
present in a crunched static binary.  part of PR 26458.
2004-09-01 01:47:09 +00:00
wiz 3b1edec30d Call -t argument fstypelist, to be in sync with code
and usage. Okayed by christos.
2004-04-21 22:31:16 +00:00
christos ae0b00db5d Make options match reality and agree with the source.
Don't document -A; it is there for compatibility only, and we want to
deprecate its use.
2004-04-21 19:17:00 +00:00
christos ba0b3992d2 add #ifdef SMALL so that we can use this in the install media. 2004-04-21 15:20:40 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
dsl 8cc28b4b81 stop umount temporarily modifying what might be argv[n]. 2004-03-12 21:48:32 +00:00
dsl ff49552bb2 KNF and const sprinkle 2004-03-12 21:26:43 +00:00
dsl b47125007b Fix 'umount host:/filesystem' - it is documented on the man page but hasn't actually
worked for 10 years!
Remove the (broken) code that once supported 'umount /filesystem@host' since that
syntax isn't used anywhere.
Fixes PR bin/22099
2004-03-12 21:14:29 +00:00
agc 276d62f603 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
lukem 7360d7b6ae Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path 2002-08-19 10:16:51 +00:00
wiz 73f545bb5b Drop arguments of .Os. 2001-06-05 11:22:41 +00:00
fvdl d65482091f Adapt to new RPC interface. Use getaddrinfo(), not gethostbyname(). 2000-06-20 00:45:24 +00:00
chs 09218270f0 change ``-a'' to be a synonym for ``-A''.
addresses PR 7629.
2000-06-06 07:09:14 +00:00
drochner 85cbf55d16 Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
sommerfeld 95d53bad01 Fix PR7747: umount -R dumps core
(fix by Ronald Khoo from PR applied)
1999-08-02 02:40:38 +00:00
fair 9fc45baff5 Changes to implement "-R" (raw) option to umount, per PR#4030. 1998-04-17 01:19:42 +00:00
kleink b5d46707c3 No need to include <sys/socketvar.h>. 1998-04-01 15:20:25 +00:00
mikel e0fbb13a20 document -F flag; part of PR 4030 from der Mouse 1997-12-18 07:11:48 +00:00
drochner 6403c86ce4 Since umount works from the top we have to traverse the information
returned by getmountinfo() from the top too. Otherwise we get
the wrong mount data in case of 2 mounts on 1 pountpoint.
1997-11-01 12:54:45 +00:00
enami 0d4522a03f Fix .Nm usage. 1997-10-20 09:11:16 +00:00