Deleted Added
full compact
tftp.c (99558) tftp.c (111776)
1/* $NetBSD: tftp.c,v 1.4 1997/09/17 16:57:07 drochner Exp $ */
2
3/*
4 * Copyright (c) 1996
5 * Matthias Drochner. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 18 unchanged lines hidden (view full) ---

27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include <sys/cdefs.h>
1/* $NetBSD: tftp.c,v 1.4 1997/09/17 16:57:07 drochner Exp $ */
2
3/*
4 * Copyright (c) 1996
5 * Matthias Drochner. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 18 unchanged lines hidden (view full) ---

27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/lib/libstand/tftp.c 99558 2002-07-07 23:01:36Z jake $");
35__FBSDID("$FreeBSD: head/lib/libstand/tftp.c 111776 2003-03-03 00:58:47Z marcel $");
36
37/*
38 * Simple TFTP implementation for libsa.
39 * Assumes:
40 * - socket descriptor (int) at open_file->f_devdata
41 * - server host IP in global servip
42 * Restrictions:
43 * - read only

--- 205 unchanged lines hidden (view full) ---

249tftp_open(path, f)
250 const char *path;
251 struct open_file *f;
252{
253 struct tftp_handle *tftpfile;
254 struct iodesc *io;
255 int res;
256
36
37/*
38 * Simple TFTP implementation for libsa.
39 * Assumes:
40 * - socket descriptor (int) at open_file->f_devdata
41 * - server host IP in global servip
42 * Restrictions:
43 * - read only

--- 205 unchanged lines hidden (view full) ---

249tftp_open(path, f)
250 const char *path;
251 struct open_file *f;
252{
253 struct tftp_handle *tftpfile;
254 struct iodesc *io;
255 int res;
256
257#ifdef __sparc64__
257#ifndef __i386__
258 if (strcmp(f->f_dev->dv_name, "net") != 0)
259 return (EINVAL);
260#endif
258 if (strcmp(f->f_dev->dv_name, "net") != 0)
259 return (EINVAL);
260#endif
261
261 tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile));
262 if (!tftpfile)
263 return (ENOMEM);
264
265 tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
266 if (io == NULL)
267 return (EINVAL);
268

--- 157 unchanged lines hidden ---
262 tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile));
263 if (!tftpfile)
264 return (ENOMEM);
265
266 tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
267 if (io == NULL)
268 return (EINVAL);
269

--- 157 unchanged lines hidden ---