diff options
author | dteske <dteske@FreeBSD.org> | 2013-07-04 20:12:12 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-07-04 20:12:12 +0000 |
commit | d22cbd9996dd8eeb66460e624d65b8abd94f8c4e (patch) | |
tree | ed5346e9e8f574fef1a7c5c9b6c87afd2fff418f /usr.sbin/bsdconfig/share/media/nfs.subr | |
parent | eeea14c75af862477741d779b12b307abdd49fbc (diff) | |
download | FreeBSD-src-d22cbd9996dd8eeb66460e624d65b8abd94f8c4e.zip FreeBSD-src-d22cbd9996dd8eeb66460e624d65b8abd94f8c4e.tar.gz |
Implement $probe_only for the media access modules. sysinstall(8) was
allowed to ignore the probe_only argument of its member functions solely
because in the C language, the file accessor methods open and return a file
descriptor and reading of the data is optional. In shell, the file accessor
methods return data on stdout and that data should not be ignored (large
files could block execution).
So, we must adhere to the probe_only flags and in some cases (in the case of
FTP, for example) change the `get' strategy to simply test existence and
return an appropriate status.
This was required because the up-coming package management stuff makes heavy
use of the probe_only argument to try different package suffixes. Every
media access module must implement $probe_only for the `get' accessor.
Diffstat (limited to 'usr.sbin/bsdconfig/share/media/nfs.subr')
-rw-r--r-- | usr.sbin/bsdconfig/share/media/nfs.subr | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bsdconfig/share/media/nfs.subr b/usr.sbin/bsdconfig/share/media/nfs.subr index b1dad4f..86bdde2 100644 --- a/usr.sbin/bsdconfig/share/media/nfs.subr +++ b/usr.sbin/bsdconfig/share/media/nfs.subr @@ -210,8 +210,8 @@ f_media_init_nfs() # f_media_get_nfs $device $file [$probe_only] # -# Returns data from $file on a mounted NFS device. Similar to cat(1). -# $probe_only is currently unused by this media type. +# Returns data from $file on a mounted NFS device. Similar to cat(1). If +# $probe_only is present and non-NULL, returns success if $file exists. # f_media_get_nfs() { @@ -220,7 +220,7 @@ f_media_get_nfs() f_dprintf "f_media_get_nfs: dev=[%s] file=[%s] probe_only=%s" \ "$dev" "$file" "$probe_only" - f_media_generic_get "$MOUNTPOINT" "$file" + f_media_generic_get "$MOUNTPOINT" "$file" "$probe_only" } # f_media_shutdown_nfs $device |