summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1997-11-12 04:39:33 +0000
committerobrien <obrien@FreeBSD.org>1997-11-12 04:39:33 +0000
commit88e48b4b98e11a59cad7cf68de7887e54bc94a5b (patch)
tree8c5e57ac2ac5338b0cf6feb156ee157fa053a216 /usr.bin/fetch
parent33bb94d3058a3608b85a58cff259dd47456c3328 (diff)
downloadFreeBSD-src-88e48b4b98e11a59cad7cf68de7887e54bc94a5b.zip
FreeBSD-src-88e48b4b98e11a59cad7cf68de7887e54bc94a5b.tar.gz
style-police got me. :-)
Also fixed some "didn't make the most sense" problems. Submitted by: bde
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/file.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/fetch/file.c b/usr.bin/fetch/file.c
index 7376933..2505353 100644
--- a/usr.bin/fetch/file.c
+++ b/usr.bin/fetch/file.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: file.c,v 1.1 1997/01/30 21:43:39 wollman Exp $
+ * $Id: file.c,v 1.2 1997/11/08 22:15:55 obrien Exp $
*/
#include <sys/types.h>
@@ -40,7 +40,6 @@
#include <sysexits.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -98,6 +97,8 @@ file_close(struct fetch_state *fs)
static int
file_retrieve(struct fetch_state *fs)
{
+ struct stat sb;
+
/* XXX - this seems bogus to me! */
if (access(fs->fs_outputfile, F_OK) == 0) {
errno = EEXIST;
@@ -106,10 +107,13 @@ file_retrieve(struct fetch_state *fs)
}
if (fs->fs_linkfile) {
- struct stat sb;
+ fs->fs_status = "checking path";
+ if (stat(fs->fs_proto, &sb) == -1) {
+ warn("non-unexistent");
+ return EX_NOINPUT;
+ }
fs->fs_status = "symlink";
- if (stat(fs->fs_proto, &sb) == -1
- || symlink(fs->fs_proto, fs->fs_outputfile) == -1) {
+ if (symlink(fs->fs_proto, fs->fs_outputfile) == -1) {
warn("symlink");
return EX_OSERR;
}
OpenPOWER on IntegriCloud