diff options
author | obrien <obrien@FreeBSD.org> | 1997-11-12 04:39:33 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 1997-11-12 04:39:33 +0000 |
commit | 88e48b4b98e11a59cad7cf68de7887e54bc94a5b (patch) | |
tree | 8c5e57ac2ac5338b0cf6feb156ee157fa053a216 /usr.bin | |
parent | 33bb94d3058a3608b85a58cff259dd47456c3328 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.bin/fetch/file.c | 14 |
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; } |