mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 15:15:44 +00:00
Remove stray white spaces.
This commit is contained in:
@@ -2,18 +2,18 @@
|
||||
* File Transfer Protocol client declarations
|
||||
*
|
||||
* Transfer file to/from remote host
|
||||
*
|
||||
*
|
||||
*
|
||||
* (c) Copyright 2002
|
||||
* Thomas Doerfler
|
||||
* IMD Ingenieurbuero fuer Microcomputertechnik
|
||||
* Herbststr. 8
|
||||
* 82178 Puchheim, Germany
|
||||
* 82178 Puchheim, Germany
|
||||
* <Thomas.Doerfler@imd-systems.de>
|
||||
*
|
||||
* This code has been created after closly inspecting
|
||||
* This code has been created after closly inspecting
|
||||
* "tftpdriver.c" from Eric Norum.
|
||||
*
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
------------------------------------------------------------------------
|
||||
$Id$
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Copyright Cybertec Pty Ltd, 2000
|
||||
All rights reserved Cybertec Pty Ltd, 2000
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
The license and distribution terms for this file may be
|
||||
found in the file LICENSE in this distribution or at
|
||||
|
||||
|
||||
http://www.rtems.com/license/LICENSE.
|
||||
|
||||
This software with is provided ``as is'' and with NO WARRANTY.
|
||||
@@ -22,7 +22,7 @@
|
||||
in RTEMS is the In Memory Filesystem (IMFS). We could copy an exiting
|
||||
filesystem to here, how-ever a number of files can have target
|
||||
specific initialisation info which we need to write.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
@@ -81,7 +81,7 @@ rtems_rootfs_mkdir (const char *path_orig, mode_t omode)
|
||||
printf ("root fs: mkdir path too long `%s'\n", path);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
strcpy (path, path_orig);
|
||||
oumask = 0;
|
||||
retval = 0;
|
||||
@@ -174,7 +174,7 @@ rtems_rootfs_file_append (const char *file,
|
||||
*/
|
||||
|
||||
fd = -1;
|
||||
|
||||
|
||||
if (stat(file, &sb))
|
||||
{
|
||||
if (errno == ENOENT)
|
||||
@@ -200,14 +200,14 @@ rtems_rootfs_file_append (const char *file,
|
||||
|
||||
strncpy (path, file, i);
|
||||
path[i] = '\0';
|
||||
|
||||
|
||||
if (rtems_rootfs_mkdir (path, MKDIR_MODE))
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
i--;
|
||||
}
|
||||
|
||||
|
||||
if ((fd = open (file, O_CREAT | O_APPEND | O_WRONLY, omode)) < 0)
|
||||
{
|
||||
printf ("root fs, cannot create file `%s' : %s\n",
|
||||
@@ -226,7 +226,7 @@ rtems_rootfs_file_append (const char *file,
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (i = 0; i < line_cnt; i++)
|
||||
{
|
||||
int len = strlen (lines[i]);
|
||||
@@ -242,7 +242,7 @@ rtems_rootfs_file_append (const char *file,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return close (fd);
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ rtems_rootfs_append_host_rec (unsigned long cip,
|
||||
struct in_addr ip;
|
||||
|
||||
ip.s_addr = cip;
|
||||
|
||||
|
||||
if (cname && strlen (cname))
|
||||
{
|
||||
snprintf (bufp, sizeof (buf), "%s\t\t%s", inet_ntoa (ip), cname);
|
||||
@@ -272,11 +272,11 @@ rtems_rootfs_append_host_rec (unsigned long cip,
|
||||
snprintf (bufp, sizeof (buf), "\t\t%s.%s", cname, dname);
|
||||
bufp += strlen (buf);
|
||||
}
|
||||
|
||||
|
||||
strcat (buf, "\n");
|
||||
|
||||
|
||||
bufl[0] = buf;
|
||||
|
||||
|
||||
if (rtems_rootfs_file_append ("/etc/hosts", MKFILE_MODE, 1, bufl) < 0)
|
||||
return -1;
|
||||
}
|
||||
@@ -298,7 +298,7 @@ rtems_create_root_fs ()
|
||||
{
|
||||
const char *lines[1];
|
||||
int i;
|
||||
|
||||
|
||||
/*
|
||||
* Create the directories.
|
||||
*/
|
||||
@@ -314,18 +314,18 @@ rtems_create_root_fs ()
|
||||
* The TCP/IP stack likes this one. If DNS does not work
|
||||
* use the host file.
|
||||
*/
|
||||
|
||||
|
||||
lines[0] = "hosts,bind\n";
|
||||
|
||||
|
||||
if (rtems_rootfs_file_append ("/etc/host.conf", MKFILE_MODE, 1, lines))
|
||||
return -1;
|
||||
|
||||
|
||||
/*
|
||||
* Create a `/etc/hosts' file.
|
||||
*/
|
||||
|
||||
if (rtems_rootfs_append_host_rec (0x7f000001, "localhost", "localdomain"))
|
||||
return -1;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
------------------------------------------------------------------------
|
||||
$Id$
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
Copyright Cybertec Pty Ltd, 2000
|
||||
All rights reserved Cybertec Pty Ltd, 2000
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
|
||||
The license and distribution terms for this file may be
|
||||
found in the file LICENSE in this distribution or at
|
||||
|
||||
|
||||
http://www.rtems.com/license/LICENSE.
|
||||
|
||||
This software with is provided ``as is'' and with NO WARRANTY.
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
RTEMS Root FS creatation support.
|
||||
@@ -30,7 +30,7 @@
|
||||
/*
|
||||
* Builds the complete path, like "mkdir -p".
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
rtems_rootfs_mkdir (const char *path, mode_t omode);
|
||||
|
||||
@@ -38,7 +38,7 @@ rtems_rootfs_mkdir (const char *path, mode_t omode);
|
||||
* Appends the lines to the a file. Create the file
|
||||
* and builds the path if it does not exist.
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
rtems_rootfs_file_append (const char *file,
|
||||
mode_t omode,
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef long long vm_ooffset_t;
|
||||
typedef unsigned int vm_pindex_t;
|
||||
typedef unsigned int vm_size_t;
|
||||
|
||||
#define _BSD_OFF_T_ int32_t
|
||||
#define _BSD_OFF_T_ int32_t
|
||||
#define _BSD_PID_T_ rtems_id
|
||||
#define _BSD_VA_LIST_ char *
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ bsd_init (void)
|
||||
* Setup the sysctl, normally done by a SYSINIT call.
|
||||
*/
|
||||
sysctl_register_all(0);
|
||||
|
||||
|
||||
/*
|
||||
* Set up interfaces
|
||||
*/
|
||||
@@ -362,7 +362,7 @@ sbwait(sb)
|
||||
* The sleep/wakeup synchronization in the FreeBSD
|
||||
* kernel has no memory.
|
||||
*/
|
||||
rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
|
||||
rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
|
||||
|
||||
/*
|
||||
* Set this task as the target of the wakeup operation.
|
||||
@@ -449,7 +449,7 @@ soconnsleep (struct socket *so)
|
||||
* The sleep/wakeup synchronization in the FreeBSD
|
||||
* kernel has no memory.
|
||||
*/
|
||||
rtems_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
|
||||
rtems_event_receive (SOSLEEP_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
|
||||
|
||||
/*
|
||||
* Set this task as the target of the wakeup operation.
|
||||
@@ -532,7 +532,7 @@ networkDaemon (void *task_argument)
|
||||
ticksPassed = now - ticksWhenCalloutsLastChecked;
|
||||
if (ticksPassed != 0) {
|
||||
ticksWhenCalloutsLastChecked = now;
|
||||
|
||||
|
||||
c = calltodo.c_next;
|
||||
if (c) {
|
||||
c->c_time -= ticksPassed;
|
||||
@@ -567,7 +567,7 @@ static void
|
||||
taskEntry (rtems_task_argument arg)
|
||||
{
|
||||
struct newtask t;
|
||||
|
||||
|
||||
/*
|
||||
* Pick up task information and free
|
||||
* the memory allocated to pass the
|
||||
@@ -745,7 +745,7 @@ void
|
||||
rtems_bsdnet_log (int priority, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
||||
if (priority & rtems_bsdnet_log_priority) {
|
||||
va_start (args, fmt);
|
||||
vprintf (fmt, args);
|
||||
@@ -875,7 +875,7 @@ rtems_bsdnet_setup (void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Set interface broadcast address if the interface has the
|
||||
* Set interface broadcast address if the interface has the
|
||||
* broadcast flag set.
|
||||
*/
|
||||
if (rtems_bsdnet_ifconfig (ifp->name, SIOCGIFFLAGS, &flags) < 0) {
|
||||
@@ -886,7 +886,7 @@ rtems_bsdnet_setup (void)
|
||||
memset (&broadcast, '\0', sizeof broadcast);
|
||||
broadcast.sin_len = sizeof broadcast;
|
||||
broadcast.sin_family = AF_INET;
|
||||
broadcast.sin_addr.s_addr =
|
||||
broadcast.sin_addr.s_addr =
|
||||
address.sin_addr.s_addr | ~netmask.sin_addr.s_addr;
|
||||
if (rtems_bsdnet_ifconfig (ifp->name, SIOCSIFBRDADDR, &broadcast) < 0) {
|
||||
struct in_addr in_addr;
|
||||
@@ -911,7 +911,7 @@ rtems_bsdnet_setup (void)
|
||||
gateway.sin_family = AF_INET;
|
||||
gateway.sin_addr.s_addr = inet_addr (rtems_bsdnet_config.gateway);
|
||||
if (rtems_bsdnet_rtrequest (
|
||||
RTM_ADD,
|
||||
RTM_ADD,
|
||||
(struct sockaddr *)&address,
|
||||
(struct sockaddr *)&gateway,
|
||||
(struct sockaddr *)&netmask,
|
||||
@@ -1096,8 +1096,8 @@ int rtems_bsdnet_ifconfig (const char *ifname, uint32_t cmd, void *param)
|
||||
if ((r = ioctl (s, cmd, &ifreq)) < 0)
|
||||
break;
|
||||
*((int*) param) = ifreq.ifr_media;
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case SIOCAIFADDR:
|
||||
case SIOCDIFADDR:
|
||||
r = ioctl(s, cmd, (struct freq *) param);
|
||||
|
||||
@@ -98,7 +98,7 @@ selscan (rtems_id tid, fd_mask **ibits, fd_mask **obits, int nfd, int *retval)
|
||||
if (so == NULL)
|
||||
return (EBADF);
|
||||
if (socket_select (so, flag[msk], tid)) {
|
||||
obits[msk][fd/NFDBITS] |=
|
||||
obits[msk][fd/NFDBITS] |=
|
||||
(1 << (fd % NFDBITS));
|
||||
n++;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct t
|
||||
#undef getbits
|
||||
|
||||
rtems_task_ident (RTEMS_SELF, 0, &tid);
|
||||
rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
|
||||
rtems_event_receive (SBWAIT_EVENT, RTEMS_EVENT_ANY | RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &events);
|
||||
for (;;) {
|
||||
rtems_bsdnet_semaphore_obtain ();
|
||||
error = selscan(tid, ibits, obits, nfds, &retval);
|
||||
|
||||
@@ -49,7 +49,7 @@ rtems_bsdnet_show_if_stats (void)
|
||||
for (ifa = ifp->if_addrlist ; ifa ; ifa = ifa->ifa_next) {
|
||||
|
||||
if ( !ifa->ifa_addr )
|
||||
continue;
|
||||
continue;
|
||||
|
||||
switch ( ifa->ifa_addr->sa_family ) {
|
||||
case AF_LINK:
|
||||
|
||||
@@ -164,7 +164,7 @@ link_ascii (struct sockaddr_dl *sdl, char *buf, int bufsize)
|
||||
*cp = '\0';
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
rtems_bsdnet_show_inet_routes (void)
|
||||
{
|
||||
|
||||
@@ -338,7 +338,7 @@ sendmsg (int s, const struct msghdr *mp, int flags)
|
||||
if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
|
||||
error = 0;
|
||||
}
|
||||
if (error)
|
||||
if (error)
|
||||
errno = error;
|
||||
else
|
||||
ret = len - auio.uio_resid;
|
||||
@@ -413,7 +413,7 @@ recvmsg (int s, struct msghdr *mp, int flags)
|
||||
}
|
||||
len = auio.uio_resid;
|
||||
mp->msg_flags = flags;
|
||||
error = soreceive (so, &from, &auio, (struct mbuf **)NULL,
|
||||
error = soreceive (so, &from, &auio, (struct mbuf **)NULL,
|
||||
mp->msg_control ? &control : (struct mbuf **)NULL,
|
||||
&mp->msg_flags);
|
||||
if (error) {
|
||||
@@ -449,7 +449,7 @@ recvmsg (int s, struct msghdr *mp, int flags)
|
||||
while (m && (len > 0)) {
|
||||
unsigned int tocopy;
|
||||
|
||||
if (len >= m->m_len)
|
||||
if (len >= m->m_len)
|
||||
tocopy = m->m_len;
|
||||
else {
|
||||
mp->msg_flags |= MSG_CTRUNC;
|
||||
@@ -642,13 +642,13 @@ sysctl(int *name, u_int namelen, void *oldp,
|
||||
int error;
|
||||
size_t j;
|
||||
|
||||
rtems_bsdnet_semaphore_obtain ();
|
||||
rtems_bsdnet_semaphore_obtain ();
|
||||
error = userland_sysctl (0, name, namelen, oldp, oldlenp, 1, newp, newlen, &j);
|
||||
rtems_bsdnet_semaphore_release ();
|
||||
|
||||
if (oldlenp)
|
||||
*oldlenp = j;
|
||||
|
||||
|
||||
if (error)
|
||||
{
|
||||
errno = error;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
*
|
||||
*
|
||||
* To open `/bootfiles/image' on `hostname' for reading:
|
||||
* fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY);
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user