summaryrefslogtreecommitdiff
path: root/usr.bin/fetch/file.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>1997-11-08 22:15:55 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>1997-11-08 22:15:55 +0000
commite4b172e407df6756fdb5403492a3a23236fa80f6 (patch)
treef6e4c954c8a8185b3684c11d24610a2df0640257 /usr.bin/fetch/file.c
parentc3b056645f42aaabfde03f62aa43dc75ffb1884a (diff)
Notes
Diffstat (limited to 'usr.bin/fetch/file.c')
-rw-r--r--usr.bin/fetch/file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/fetch/file.c b/usr.bin/fetch/file.c
index 091639c9a18ba..73769335ec304 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$
+ * $Id: file.c,v 1.1 1997/01/30 21:43:39 wollman Exp $
*/
#include <sys/types.h>
@@ -40,6 +40,8 @@
#include <sysexits.h>
#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/wait.h>
#include "fetch.h"
@@ -104,8 +106,10 @@ file_retrieve(struct fetch_state *fs)
}
if (fs->fs_linkfile) {
+ struct stat sb;
fs->fs_status = "symlink";
- if (symlink(fs->fs_proto, fs->fs_outputfile) == -1) {
+ if (stat(fs->fs_proto, &sb) == -1
+ || symlink(fs->fs_proto, fs->fs_outputfile) == -1) {
warn("symlink");
return EX_OSERR;
}