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/usb.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/usb.subr')
-rw-r--r-- | usr.sbin/bsdconfig/share/media/usb.subr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bsdconfig/share/media/usb.subr b/usr.sbin/bsdconfig/share/media/usb.subr index 4117e51..c2ece47 100644 --- a/usr.sbin/bsdconfig/share/media/usb.subr +++ b/usr.sbin/bsdconfig/share/media/usb.subr @@ -135,7 +135,7 @@ f_media_init_usb() # f_media_get_usb $device $file [$probe_only] # # Returns data from $file on a mounted USB disk device. Similar to cat(1). -# $probe_only is currently unused by this media type. +# If $probe_only is present and non-NULL, returns success if $file exists. # f_media_get_usb() { @@ -144,7 +144,7 @@ f_media_get_usb() f_dprintf "f_media_get_usb: 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_usb $device |