Remove stray white spaces.

This commit is contained in:
Ralf Corsepius
2004-04-18 06:19:33 +00:00
parent a0ed4edee0
commit 429ba3b6ee
10 changed files with 49 additions and 49 deletions

View File

@@ -2,18 +2,18 @@
* File Transfer Protocol client declarations * File Transfer Protocol client declarations
* *
* Transfer file to/from remote host * Transfer file to/from remote host
* *
* *
* (c) Copyright 2002 * (c) Copyright 2002
* Thomas Doerfler * Thomas Doerfler
* IMD Ingenieurbuero fuer Microcomputertechnik * IMD Ingenieurbuero fuer Microcomputertechnik
* Herbststr. 8 * Herbststr. 8
* 82178 Puchheim, Germany * 82178 Puchheim, Germany
* <Thomas.Doerfler@imd-systems.de> * <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. * "tftpdriver.c" from Eric Norum.
* *
* $Id$ * $Id$
*/ */

View File

@@ -2,7 +2,7 @@
------------------------------------------------------------------------ ------------------------------------------------------------------------
$Id$ $Id$
------------------------------------------------------------------------ ------------------------------------------------------------------------
Copyright Cybertec Pty Ltd, 2000 Copyright Cybertec Pty Ltd, 2000
All rights reserved 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 The license and distribution terms for this file may be
found in the file LICENSE in this distribution or at found in the file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
This software with is provided ``as is'' and with NO WARRANTY. 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 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 filesystem to here, how-ever a number of files can have target
specific initialisation info which we need to write. specific initialisation info which we need to write.
*/ */
#include <errno.h> #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); printf ("root fs: mkdir path too long `%s'\n", path);
return -1; return -1;
} }
strcpy (path, path_orig); strcpy (path, path_orig);
oumask = 0; oumask = 0;
retval = 0; retval = 0;
@@ -174,7 +174,7 @@ rtems_rootfs_file_append (const char *file,
*/ */
fd = -1; fd = -1;
if (stat(file, &sb)) if (stat(file, &sb))
{ {
if (errno == ENOENT) if (errno == ENOENT)
@@ -200,14 +200,14 @@ rtems_rootfs_file_append (const char *file,
strncpy (path, file, i); strncpy (path, file, i);
path[i] = '\0'; path[i] = '\0';
if (rtems_rootfs_mkdir (path, MKDIR_MODE)) if (rtems_rootfs_mkdir (path, MKDIR_MODE))
return -1; return -1;
break; break;
} }
i--; i--;
} }
if ((fd = open (file, O_CREAT | O_APPEND | O_WRONLY, omode)) < 0) if ((fd = open (file, O_CREAT | O_APPEND | O_WRONLY, omode)) < 0)
{ {
printf ("root fs, cannot create file `%s' : %s\n", printf ("root fs, cannot create file `%s' : %s\n",
@@ -226,7 +226,7 @@ rtems_rootfs_file_append (const char *file,
return -1; return -1;
} }
} }
for (i = 0; i < line_cnt; i++) for (i = 0; i < line_cnt; i++)
{ {
int len = strlen (lines[i]); int len = strlen (lines[i]);
@@ -242,7 +242,7 @@ rtems_rootfs_file_append (const char *file,
} }
} }
} }
return close (fd); return close (fd);
} }
@@ -261,7 +261,7 @@ rtems_rootfs_append_host_rec (unsigned long cip,
struct in_addr ip; struct in_addr ip;
ip.s_addr = cip; ip.s_addr = cip;
if (cname && strlen (cname)) if (cname && strlen (cname))
{ {
snprintf (bufp, sizeof (buf), "%s\t\t%s", inet_ntoa (ip), 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); snprintf (bufp, sizeof (buf), "\t\t%s.%s", cname, dname);
bufp += strlen (buf); bufp += strlen (buf);
} }
strcat (buf, "\n"); strcat (buf, "\n");
bufl[0] = buf; bufl[0] = buf;
if (rtems_rootfs_file_append ("/etc/hosts", MKFILE_MODE, 1, bufl) < 0) if (rtems_rootfs_file_append ("/etc/hosts", MKFILE_MODE, 1, bufl) < 0)
return -1; return -1;
} }
@@ -298,7 +298,7 @@ rtems_create_root_fs ()
{ {
const char *lines[1]; const char *lines[1];
int i; int i;
/* /*
* Create the directories. * Create the directories.
*/ */
@@ -314,18 +314,18 @@ rtems_create_root_fs ()
* The TCP/IP stack likes this one. If DNS does not work * The TCP/IP stack likes this one. If DNS does not work
* use the host file. * use the host file.
*/ */
lines[0] = "hosts,bind\n"; lines[0] = "hosts,bind\n";
if (rtems_rootfs_file_append ("/etc/host.conf", MKFILE_MODE, 1, lines)) if (rtems_rootfs_file_append ("/etc/host.conf", MKFILE_MODE, 1, lines))
return -1; return -1;
/* /*
* Create a `/etc/hosts' file. * Create a `/etc/hosts' file.
*/ */
if (rtems_rootfs_append_host_rec (0x7f000001, "localhost", "localdomain")) if (rtems_rootfs_append_host_rec (0x7f000001, "localhost", "localdomain"))
return -1; return -1;
return 0; return 0;
} }

View File

@@ -2,7 +2,7 @@
------------------------------------------------------------------------ ------------------------------------------------------------------------
$Id$ $Id$
------------------------------------------------------------------------ ------------------------------------------------------------------------
Copyright Cybertec Pty Ltd, 2000 Copyright Cybertec Pty Ltd, 2000
All rights reserved 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 The license and distribution terms for this file may be
found in the file LICENSE in this distribution or at found in the file LICENSE in this distribution or at
http://www.rtems.com/license/LICENSE. http://www.rtems.com/license/LICENSE.
This software with is provided ``as is'' and with NO WARRANTY. This software with is provided ``as is'' and with NO WARRANTY.
------------------------------------------------------------------------ ------------------------------------------------------------------------
RTEMS Root FS creatation support. RTEMS Root FS creatation support.
@@ -30,7 +30,7 @@
/* /*
* Builds the complete path, like "mkdir -p". * Builds the complete path, like "mkdir -p".
*/ */
int int
rtems_rootfs_mkdir (const char *path, mode_t omode); 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 * Appends the lines to the a file. Create the file
* and builds the path if it does not exist. * and builds the path if it does not exist.
*/ */
int int
rtems_rootfs_file_append (const char *file, rtems_rootfs_file_append (const char *file,
mode_t omode, mode_t omode,

View File

@@ -19,7 +19,7 @@ typedef long long vm_ooffset_t;
typedef unsigned int vm_pindex_t; typedef unsigned int vm_pindex_t;
typedef unsigned int vm_size_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_PID_T_ rtems_id
#define _BSD_VA_LIST_ char * #define _BSD_VA_LIST_ char *

View File

@@ -204,7 +204,7 @@ bsd_init (void)
* Setup the sysctl, normally done by a SYSINIT call. * Setup the sysctl, normally done by a SYSINIT call.
*/ */
sysctl_register_all(0); sysctl_register_all(0);
/* /*
* Set up interfaces * Set up interfaces
*/ */
@@ -362,7 +362,7 @@ sbwait(sb)
* The sleep/wakeup synchronization in the FreeBSD * The sleep/wakeup synchronization in the FreeBSD
* kernel has no memory. * 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. * 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 * The sleep/wakeup synchronization in the FreeBSD
* kernel has no memory. * 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. * Set this task as the target of the wakeup operation.
@@ -532,7 +532,7 @@ networkDaemon (void *task_argument)
ticksPassed = now - ticksWhenCalloutsLastChecked; ticksPassed = now - ticksWhenCalloutsLastChecked;
if (ticksPassed != 0) { if (ticksPassed != 0) {
ticksWhenCalloutsLastChecked = now; ticksWhenCalloutsLastChecked = now;
c = calltodo.c_next; c = calltodo.c_next;
if (c) { if (c) {
c->c_time -= ticksPassed; c->c_time -= ticksPassed;
@@ -567,7 +567,7 @@ static void
taskEntry (rtems_task_argument arg) taskEntry (rtems_task_argument arg)
{ {
struct newtask t; struct newtask t;
/* /*
* Pick up task information and free * Pick up task information and free
* the memory allocated to pass the * the memory allocated to pass the
@@ -745,7 +745,7 @@ void
rtems_bsdnet_log (int priority, const char *fmt, ...) rtems_bsdnet_log (int priority, const char *fmt, ...)
{ {
va_list args; va_list args;
if (priority & rtems_bsdnet_log_priority) { if (priority & rtems_bsdnet_log_priority) {
va_start (args, fmt); va_start (args, fmt);
vprintf (fmt, args); 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. * broadcast flag set.
*/ */
if (rtems_bsdnet_ifconfig (ifp->name, SIOCGIFFLAGS, &flags) < 0) { if (rtems_bsdnet_ifconfig (ifp->name, SIOCGIFFLAGS, &flags) < 0) {
@@ -886,7 +886,7 @@ rtems_bsdnet_setup (void)
memset (&broadcast, '\0', sizeof broadcast); memset (&broadcast, '\0', sizeof broadcast);
broadcast.sin_len = sizeof broadcast; broadcast.sin_len = sizeof broadcast;
broadcast.sin_family = AF_INET; 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; address.sin_addr.s_addr | ~netmask.sin_addr.s_addr;
if (rtems_bsdnet_ifconfig (ifp->name, SIOCSIFBRDADDR, &broadcast) < 0) { if (rtems_bsdnet_ifconfig (ifp->name, SIOCSIFBRDADDR, &broadcast) < 0) {
struct in_addr in_addr; struct in_addr in_addr;
@@ -911,7 +911,7 @@ rtems_bsdnet_setup (void)
gateway.sin_family = AF_INET; gateway.sin_family = AF_INET;
gateway.sin_addr.s_addr = inet_addr (rtems_bsdnet_config.gateway); gateway.sin_addr.s_addr = inet_addr (rtems_bsdnet_config.gateway);
if (rtems_bsdnet_rtrequest ( if (rtems_bsdnet_rtrequest (
RTM_ADD, RTM_ADD,
(struct sockaddr *)&address, (struct sockaddr *)&address,
(struct sockaddr *)&gateway, (struct sockaddr *)&gateway,
(struct sockaddr *)&netmask, (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) if ((r = ioctl (s, cmd, &ifreq)) < 0)
break; break;
*((int*) param) = ifreq.ifr_media; *((int*) param) = ifreq.ifr_media;
break; break;
case SIOCAIFADDR: case SIOCAIFADDR:
case SIOCDIFADDR: case SIOCDIFADDR:
r = ioctl(s, cmd, (struct freq *) param); r = ioctl(s, cmd, (struct freq *) param);

View File

@@ -98,7 +98,7 @@ selscan (rtems_id tid, fd_mask **ibits, fd_mask **obits, int nfd, int *retval)
if (so == NULL) if (so == NULL)
return (EBADF); return (EBADF);
if (socket_select (so, flag[msk], tid)) { if (socket_select (so, flag[msk], tid)) {
obits[msk][fd/NFDBITS] |= obits[msk][fd/NFDBITS] |=
(1 << (fd % NFDBITS)); (1 << (fd % NFDBITS));
n++; n++;
} }
@@ -144,7 +144,7 @@ select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct t
#undef getbits #undef getbits
rtems_task_ident (RTEMS_SELF, 0, &tid); 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 (;;) { for (;;) {
rtems_bsdnet_semaphore_obtain (); rtems_bsdnet_semaphore_obtain ();
error = selscan(tid, ibits, obits, nfds, &retval); error = selscan(tid, ibits, obits, nfds, &retval);

View File

@@ -49,7 +49,7 @@ rtems_bsdnet_show_if_stats (void)
for (ifa = ifp->if_addrlist ; ifa ; ifa = ifa->ifa_next) { for (ifa = ifp->if_addrlist ; ifa ; ifa = ifa->ifa_next) {
if ( !ifa->ifa_addr ) if ( !ifa->ifa_addr )
continue; continue;
switch ( ifa->ifa_addr->sa_family ) { switch ( ifa->ifa_addr->sa_family ) {
case AF_LINK: case AF_LINK:

View File

@@ -164,7 +164,7 @@ link_ascii (struct sockaddr_dl *sdl, char *buf, int bufsize)
*cp = '\0'; *cp = '\0';
return buf; return buf;
} }
void void
rtems_bsdnet_show_inet_routes (void) rtems_bsdnet_show_inet_routes (void)
{ {

View File

@@ -338,7 +338,7 @@ sendmsg (int s, const struct msghdr *mp, int flags)
if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK)) if (auio.uio_resid != len && (error == EINTR || error == EWOULDBLOCK))
error = 0; error = 0;
} }
if (error) if (error)
errno = error; errno = error;
else else
ret = len - auio.uio_resid; ret = len - auio.uio_resid;
@@ -413,7 +413,7 @@ recvmsg (int s, struct msghdr *mp, int flags)
} }
len = auio.uio_resid; len = auio.uio_resid;
mp->msg_flags = flags; 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_control ? &control : (struct mbuf **)NULL,
&mp->msg_flags); &mp->msg_flags);
if (error) { if (error) {
@@ -449,7 +449,7 @@ recvmsg (int s, struct msghdr *mp, int flags)
while (m && (len > 0)) { while (m && (len > 0)) {
unsigned int tocopy; unsigned int tocopy;
if (len >= m->m_len) if (len >= m->m_len)
tocopy = m->m_len; tocopy = m->m_len;
else { else {
mp->msg_flags |= MSG_CTRUNC; mp->msg_flags |= MSG_CTRUNC;
@@ -642,13 +642,13 @@ sysctl(int *name, u_int namelen, void *oldp,
int error; int error;
size_t j; size_t j;
rtems_bsdnet_semaphore_obtain (); rtems_bsdnet_semaphore_obtain ();
error = userland_sysctl (0, name, namelen, oldp, oldlenp, 1, newp, newlen, &j); error = userland_sysctl (0, name, namelen, oldp, oldlenp, 1, newp, newlen, &j);
rtems_bsdnet_semaphore_release (); rtems_bsdnet_semaphore_release ();
if (oldlenp) if (oldlenp)
*oldlenp = j; *oldlenp = j;
if (error) if (error)
{ {
errno = error; errno = error;

View File

@@ -16,7 +16,7 @@
/* /*
* Usage: * Usage:
* *
* To open `/bootfiles/image' on `hostname' for reading: * To open `/bootfiles/image' on `hostname' for reading:
* fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY); * fd = open ("/TFTP/hostname/bootfiles/image", O_RDONLY);
* *