Changeset ebf2bc6 in rtems


Ignore:
Timestamp:
Apr 30, 2010, 8:52:29 AM (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10, 4.11, master
Children:
068a824
Parents:
361e26d
Message:

2010-04-30 Sebastian Huber <sebastian.huber@…>

  • libnetworking/lib/ftpfs.c: Format changes. Fixed pathname allocation in rtems_ftpfs_eval_path(). Send QUIT command during file close.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r361e26d rebf2bc6  
     12010-04-30      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * libnetworking/lib/ftpfs.c: Format changes.  Fixed pathname
     4        allocation in rtems_ftpfs_eval_path().  Send QUIT command during
     5        file close.
     6
    172010-04-30      Sebastian Huber <sebastian.huber@embedded-brains.de>
    28
  • cpukit/libnetworking/lib/ftpfs.c

    r361e26d rebf2bc6  
    66
    77/*
    8  * Copyright (c) 2009
     8 * Copyright (c) 2009, 2010
    99 * embedded brains GmbH
    1010 * Obere Lagerstr. 30
     
    6060
    6161#ifdef DEBUG
    62   #define DEBUG_PRINTF( ...) printf( __VA_ARGS__)
     62  #define DEBUG_PRINTF(...) printf(__VA_ARGS__)
    6363#else
    64   #define DEBUG_PRINTF( ...)
     64  #define DEBUG_PRINTF(...)
    6565#endif
    6666
     
    104104static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers;
    105105
    106 static bool rtems_ftpfs_use_timeout( const struct timeval *to)
     106static bool rtems_ftpfs_use_timeout(const struct timeval *to)
    107107{
    108108  return to->tv_sec != 0 || to->tv_usec != 0;
     
    114114)
    115115{
    116   if (rtems_ftpfs_use_timeout( to)) {
     116  if (rtems_ftpfs_use_timeout(to)) {
    117117    int rv = 0;
    118118   
    119     rv = setsockopt( socket, SOL_SOCKET, SO_SNDTIMEO, to, sizeof( *to));
     119    rv = setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, to, sizeof(*to));
    120120    if (rv != 0) {
    121121      return EIO;
    122122    }
    123123
    124     rv = setsockopt( socket, SOL_SOCKET, SO_RCVTIMEO, to, sizeof( *to));
     124    rv = setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, to, sizeof(*to));
    125125    if (rv != 0) {
    126126      return EIO;
     
    131131}
    132132
    133 rtems_status_code rtems_ftpfs_mount( const char *mount_point)
     133rtems_status_code rtems_ftpfs_mount(const char *mount_point)
    134134{
    135135  int rv = 0;
     
    139139  }
    140140
    141   rv = mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
     141  rv = mkdir(mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
    142142  if (rv != 0) {
    143143    return RTEMS_IO_ERROR;
     
    173173  }
    174174
    175   fd = open( mount_point, O_RDWR);
     175  fd = open(mount_point, O_RDWR);
    176176  if (fd < 0) {
    177177    return RTEMS_INVALID_NAME;
    178178  }
    179179 
    180   va_start( ap, req);
    181   rv = ioctl( fd, req, va_arg( ap, void *));
    182   va_end( ap);
     180  va_start(ap, req);
     181  rv = ioctl(fd, req, va_arg(ap, void *));
     182  va_end(ap);
    183183  if (rv != 0) {
    184184    sc = RTEMS_INVALID_NUMBER;
    185185  }
    186186
    187   rv = close( fd);
     187  rv = close(fd);
    188188  if (rv != 0 && sc == RTEMS_SUCCESSFUL) {
    189189    sc = RTEMS_IO_ERROR;
     
    193193}
    194194
    195 rtems_status_code rtems_ftpfs_get_verbose( const char *mount_point, bool *verbose)
     195rtems_status_code rtems_ftpfs_get_verbose(const char *mount_point, bool *verbose)
    196196{
    197197  return rtems_ftpfs_do_ioctl(
     
    202202}
    203203
    204 rtems_status_code rtems_ftpfs_set_verbose( const char *mount_point, bool verbose)
     204rtems_status_code rtems_ftpfs_set_verbose(const char *mount_point, bool verbose)
    205205{
    206206  return rtems_ftpfs_do_ioctl(
     
    235235}
    236236
    237 int rtems_bsdnet_initialize_ftp_filesystem( void)
     237int rtems_bsdnet_initialize_ftp_filesystem(void)
    238238{
    239239  rtems_status_code sc = RTEMS_SUCCESSFUL;
    240240
    241   sc = rtems_ftpfs_mount( NULL);
     241  sc = rtems_ftpfs_mount(NULL);
    242242
    243243  if (sc == RTEMS_SUCCESSFUL) {
     
    291291    /* Receive reply fragment from socket */
    292292    ssize_t i = 0;
    293     ssize_t rv = recv( socket, buf, sizeof( buf), 0);
     293    ssize_t rv = recv(socket, buf, sizeof(buf), 0);
    294294
    295295    if (rv <= 0) {
     
    299299    /* Be verbose if necessary */
    300300    if (verbose) {
    301       write( STDERR_FILENO, buf, (size_t) rv);
     301      write(STDERR_FILENO, buf, (size_t) rv);
    302302    }
    303303
    304304    /* Invoke parser if necessary */
    305305    if (parser != NULL) {
    306       parser( buf, (size_t) rv, parser_arg);
     306      parser(buf, (size_t) rv, parser_arg);
    307307    }
    308308
     
    351351    if (state == RTEMS_FTPFS_REPLY_SINGLE_LINE_DONE) {
    352352      if (
    353         isdigit( reply_first [0])
    354           && isdigit( reply_first [1])
    355           && isdigit( reply_first [2])
     353        isdigit(reply_first [0])
     354          && isdigit(reply_first [1])
     355          && isdigit(reply_first [2])
    356356      ) {
    357357        break;
     
    365365        ok = ok
    366366          && reply_first [i] == reply_last [i]
    367           && isdigit( reply_first [i]);
     367          && isdigit(reply_first [i]);
    368368      }
    369369
     
    390390
    391391  /* Send command */
    392   rv = send( socket, cmd, strlen( cmd), 0);
     392  rv = send(socket, cmd, strlen(cmd), 0);
    393393  if (rv < 0) {
    394394    return RTEMS_FTPFS_REPLY_ERROR;
    395395  }
    396396  if (verbose) {
    397     write( STDERR_FILENO, cmd, strlen( cmd));
     397    write(STDERR_FILENO, cmd, strlen(cmd));
    398398  }
    399399
    400400  /* Send command argument if necessary */
    401401  if (arg != NULL) {
    402     rv = send( socket, arg, strlen( arg), 0);
     402    rv = send(socket, arg, strlen(arg), 0);
    403403    if (rv < 0) {
    404404      return RTEMS_FTPFS_REPLY_ERROR;
    405405    }
    406406    if (verbose) {
    407       write( STDERR_FILENO, arg, strlen( arg));
     407      write(STDERR_FILENO, arg, strlen(arg));
    408408    }
    409409  }
    410410
    411411  /* Send end of line */
    412   rv = send( socket, eol, 2, 0);
     412  rv = send(socket, eol, 2, 0);
    413413  if (rv < 0) {
    414414    return RTEMS_FTPFS_REPLY_ERROR;
    415415  }
    416416  if (verbose) {
    417     write( STDERR_FILENO, &eol [1], 1);
     417    write(STDERR_FILENO, &eol [1], 1);
    418418  }
    419419
    420420  /* Return reply */
    421   return rtems_ftpfs_get_reply( socket, parser, parser_arg, verbose);
     421  return rtems_ftpfs_get_reply(socket, parser, parser_arg, verbose);
    422422}
    423423
     
    460460{
    461461  split_state state = STATE_USER_NAME;
    462   size_t len = strlen( s);
     462  size_t len = strlen(s);
    463463  size_t i = 0;
    464464
     
    544544)
    545545{
    546   memset( sa, sizeof( *sa), 0);
     546  memset(sa, sizeof(*sa), 0);
    547547
    548548  sa->sin_family = AF_INET;
    549549  sa->sin_addr.s_addr = address;
    550550  sa->sin_port = port;
    551   sa->sin_len = sizeof( *sa);
    552 
    553   return sizeof( *sa);
    554 }
    555 
    556 static int rtems_ftpfs_terminate( rtems_libio_t *iop, bool error)
     551  sa->sin_len = sizeof(*sa);
     552
     553  return sizeof(*sa);
     554}
     555
     556static int rtems_ftpfs_terminate(rtems_libio_t *iop, bool error)
    557557{
    558558  int eno = 0;
     
    561561  rtems_ftpfs_mount_entry *me = iop->pathinfo.mt_entry->fs_info;
    562562  bool verbose = me->verbose;
     563  rtems_ftpfs_reply reply = RTEMS_FTPFS_REPLY_ERROR;
    563564
    564565  if (e != NULL) {
    565566    /* Close data connection if necessary */
    566567    if (e->data_socket >= 0) {
    567       rv = close( e->data_socket);
     568      rv = close(e->data_socket);
    568569      if (rv != 0) {
    569570        eno = EIO;
     
    576577          && !error
    577578      ) {
    578         rtems_ftpfs_reply reply =
    579           rtems_ftpfs_get_reply( e->ctrl_socket, NULL, NULL, verbose);
    580 
     579        reply = rtems_ftpfs_get_reply(e->ctrl_socket, NULL, NULL, verbose);
    581580        if (reply != RTEMS_FTPFS_REPLY_2) {
    582581          eno = EIO;
     
    587586    /* Close control connection if necessary */
    588587    if (e->ctrl_socket >= 0) {
    589       rv = close( e->ctrl_socket);
     588      reply = rtems_ftpfs_send_command(
     589        e->ctrl_socket,
     590        "QUIT",
     591        NULL,
     592        verbose
     593      );
     594      if (reply != RTEMS_FTPFS_REPLY_2) {
     595        eno = EIO;
     596      }
     597
     598      rv = close(e->ctrl_socket);
    590599      if (rv != 0) {
    591600        eno = EIO;
     
    594603
    595604    /* Free connection entry */
    596     free( e);
     605    free(e);
    597606  }
    598607
     
    621630
    622631  /* Create the socket for the control connection */
    623   e->ctrl_socket = socket( AF_INET, SOCK_STREAM, 0);
     632  e->ctrl_socket = socket(AF_INET, SOCK_STREAM, 0);
    624633  if (e->ctrl_socket < 0) {
    625634    return ENOMEM;
     
    627636
    628637  /* Set up the server address from the hostname */
    629   if (hostname == NULL || strlen( hostname) == 0) {
     638  if (hostname == NULL || strlen(hostname) == 0) {
    630639    /* Default to BOOTP server address */
    631640    address = rtems_bsdnet_bootp_server_address;
    632   } else if (inet_aton( hostname, &address) == 0) {
     641  } else if (inet_aton(hostname, &address) == 0) {
    633642    /* Try to get the address by name */
    634     struct hostent *he = gethostbyname( hostname);
     643    struct hostent *he = gethostbyname(hostname);
    635644
    636645    if (he != NULL) {
    637       memcpy( &address, he->h_addr, sizeof( address));
     646      memcpy(&address, he->h_addr, sizeof(address));
    638647    } else {
    639648      return ENOENT;
    640649    }
    641650  }
    642   rtems_ftpfs_create_address( &sa, address.s_addr, htons( RTEMS_FTPFS_CTRL_PORT));
    643   DEBUG_PRINTF( "server = %s\n", inet_ntoa( sa.sin_addr));
     651  rtems_ftpfs_create_address(&sa, address.s_addr, htons(RTEMS_FTPFS_CTRL_PORT));
     652  DEBUG_PRINTF("server = %s\n", inet_ntoa(sa.sin_addr));
    644653
    645654  /* Open control connection */
     
    647656    e->ctrl_socket,
    648657    (struct sockaddr *) &sa,
    649     sizeof( sa)
     658    sizeof(sa)
    650659  );
    651660  if (rv != 0) {
     
    654663
    655664  /* Set control connection timeout */
    656   eno = rtems_ftpfs_set_connection_timeout( e->ctrl_socket, timeout);
     665  eno = rtems_ftpfs_set_connection_timeout(e->ctrl_socket, timeout);
    657666  if (eno != 0) {
    658667    return eno;
     
    660669
    661670  /* Get client address */
    662   size = rtems_ftpfs_create_address( &sa, INADDR_ANY, 0);
     671  size = rtems_ftpfs_create_address(&sa, INADDR_ANY, 0);
    663672  rv = getsockname(
    664673    e->ctrl_socket,
     
    669678    return ENOMEM;
    670679  }
    671   *client_address = ntohl( sa.sin_addr.s_addr);
    672   DEBUG_PRINTF( "client = %s\n", inet_ntoa( sa.sin_addr));
     680  *client_address = ntohl(sa.sin_addr.s_addr);
     681  DEBUG_PRINTF("client = %s\n", inet_ntoa(sa.sin_addr));
    673682
    674683  /* Now we should get a welcome message from the server */
    675   reply = rtems_ftpfs_get_reply( e->ctrl_socket, NULL, NULL, verbose);
     684  reply = rtems_ftpfs_get_reply(e->ctrl_socket, NULL, NULL, verbose);
    676685  if (reply != RTEMS_FTPFS_REPLY_2) {
    677686    return ENOENT;
     
    679688
    680689  /* Send USER command */
    681   reply = rtems_ftpfs_send_command( e->ctrl_socket, "USER ", user, verbose);
     690  reply = rtems_ftpfs_send_command(e->ctrl_socket, "USER ", user, verbose);
    682691  if (reply == RTEMS_FTPFS_REPLY_3) {
    683692    /* Send PASS command */
     
    698707
    699708  /* Send TYPE command to set binary mode for all data transfers */
    700   reply = rtems_ftpfs_send_command( e->ctrl_socket, "TYPE I", NULL, verbose);
     709  reply = rtems_ftpfs_send_command(e->ctrl_socket, "TYPE I", NULL, verbose);
    701710  if (reply != RTEMS_FTPFS_REPLY_2) {
    702711    return EIO;
     
    725734
    726735  /* Create port socket to establish a data data connection */
    727   port_socket = socket( AF_INET, SOCK_STREAM, 0);
     736  port_socket = socket(AF_INET, SOCK_STREAM, 0);
    728737  if (port_socket < 0) {
    729738    eno = ENOMEM;
     
    732741
    733742  /* Bind port socket */
    734   rtems_ftpfs_create_address( &sa, INADDR_ANY, 0);
     743  rtems_ftpfs_create_address(&sa, INADDR_ANY, 0);
    735744  rv = bind(
    736745    port_socket,
    737746    (struct sockaddr *) &sa,
    738     sizeof( sa)
     747    sizeof(sa)
    739748  );
    740749  if (rv != 0) {
     
    744753
    745754  /* Get port number for data socket */
    746   size = rtems_ftpfs_create_address( &sa, INADDR_ANY, 0);
     755  size = rtems_ftpfs_create_address(&sa, INADDR_ANY, 0);
    747756  rv = getsockname(
    748757    port_socket,
     
    754763    goto cleanup;
    755764  }
    756   data_port = ntohs( sa.sin_port);
     765  data_port = ntohs(sa.sin_port);
    757766
    758767  /* Send PORT command to set data connection port for server */
    759768  snprintf(
    760769    port_command,
    761     sizeof( port_command),
     770    sizeof(port_command),
    762771    "PORT %lu,%lu,%lu,%lu,%lu,%lu",
    763772    (client_address >> 24) & 0xffUL,
     
    780789
    781790  /* Listen on port socket for incoming data connections */
    782   rv = listen( port_socket, 1);
     791  rv = listen(port_socket, 1);
    783792  if (rv != 0) {
    784793    eno = EBUSY;
     
    799808
    800809  /* Wait for connect on data connection if necessary */
    801   if (rtems_ftpfs_use_timeout( timeout)) {
     810  if (rtems_ftpfs_use_timeout(timeout)) {
    802811    struct timeval to = *timeout;
    803812    fd_set fds;
    804813
    805     FD_ZERO( &fds);
    806     FD_SET( port_socket, &fds);
    807 
    808     rv = select( port_socket + 1, &fds, NULL, NULL, &to);
     814    FD_ZERO(&fds);
     815    FD_SET(port_socket, &fds);
     816
     817    rv = select(port_socket + 1, &fds, NULL, NULL, &to);
    809818    if (rv <= 0) {
    810819      eno = EIO;
     
    814823
    815824  /* Accept data connection  */
    816   size = sizeof( sa);
     825  size = sizeof(sa);
    817826  e->data_socket = accept(
    818827    port_socket,
     
    829838  /* Close port socket if necessary */
    830839  if (port_socket >= 0) {
    831     rv = close( port_socket);
     840    rv = close(port_socket);
    832841    if (rv != 0) {
    833842      eno = EIO;
     
    865874    switch (e->state) {
    866875      case RTEMS_FTPFS_PASV_START:
    867         if (!isdigit( c)) {
     876        if (!isdigit(c)) {
    868877          e->state = RTEMS_FTPFS_PASV_JUNK;
    869878          e->index = 0;
     
    871880        break;
    872881      case RTEMS_FTPFS_PASV_JUNK:
    873         if (isdigit( c)) {
     882        if (isdigit(c)) {
    874883          e->state = RTEMS_FTPFS_PASV_DATA;
    875884          e->data [e->index] = (uint8_t) (c - '0');
     
    877886        break;
    878887      case RTEMS_FTPFS_PASV_DATA:
    879         if (isdigit( c)) {
     888        if (isdigit(c)) {
    880889          e->data [e->index] = (uint8_t) (e->data [e->index] * 10 + c - '0');
    881890        } else if (c == ',') {
    882891          ++e->index;
    883           if (e->index < sizeof( e->data)) {
     892          if (e->index < sizeof(e->data)) {
    884893            e->data [e->index] = 0;
    885894          } else {
     
    930939    + ((uint32_t)(pe.data [2]) << 8) + ((uint32_t)(pe.data [3]));
    931940  data_port = (uint16_t) ((pe.data [4] << 8) + pe.data [5]);
    932   rtems_ftpfs_create_address( &sa, htonl( data_address), htons( data_port));
     941  rtems_ftpfs_create_address(&sa, htonl(data_address), htons(data_port));
    933942  DEBUG_PRINTF(
    934943    "server data = %s:%u\n",
    935     inet_ntoa( sa.sin_addr),
    936     (unsigned) ntohs( sa.sin_port)
     944    inet_ntoa(sa.sin_addr),
     945    (unsigned) ntohs(sa.sin_port)
    937946  );
    938947
    939948  /* Create data socket */
    940   e->data_socket = socket( AF_INET, SOCK_STREAM, 0);
     949  e->data_socket = socket(AF_INET, SOCK_STREAM, 0);
    941950  if (e->data_socket < 0) {
    942951    return ENOMEM;
     
    947956    e->data_socket,
    948957    (struct sockaddr *) &sa,
    949     sizeof( sa)
     958    sizeof(sa)
    950959  );
    951960  if (rv != 0) {
     
    9951004  /* Check location, it was allocated during path evaluation */
    9961005  if (location == NULL) {
    997     rtems_set_errno_and_return_minus_one( ENOMEM);
     1006    rtems_set_errno_and_return_minus_one(ENOMEM);
    9981007  }
    9991008
     
    10071016  );
    10081017  if (!ok) {
    1009     if (strlen( location) == 0) {
     1018    if (strlen(location) == 0) {
    10101019      /*
    10111020       * This is an access to the root node that will be used for file system
     
    10161025      return 0;
    10171026    } else {
    1018       rtems_set_errno_and_return_minus_one( ENOENT);
     1027      rtems_set_errno_and_return_minus_one(ENOENT);
    10191028    }
    10201029  }
     
    10311040      && (iop->flags & LIBIO_FLAGS_READ) != 0
    10321041  ) {
    1033     rtems_set_errno_and_return_minus_one( ENOTSUP);
     1042    rtems_set_errno_and_return_minus_one(ENOTSUP);
    10341043  }
    10351044
    10361045  /* Allocate connection entry */
    1037   e = malloc( sizeof( *e));
     1046  e = malloc(sizeof(*e));
    10381047  if (e == NULL) {
    1039     rtems_set_errno_and_return_minus_one( ENOMEM);
     1048    rtems_set_errno_and_return_minus_one(ENOMEM);
    10401049  }
    10411050
     
    10871096
    10881097  /* Set data connection timeout */
    1089   eno = rtems_ftpfs_set_connection_timeout( e->data_socket, timeout);
     1098  eno = rtems_ftpfs_set_connection_timeout(e->data_socket, timeout);
    10901099
    10911100cleanup:
     
    10951104  } else {
    10961105    /* Free all resources if an error occured */
    1097     rtems_ftpfs_terminate( iop, true);
    1098 
    1099     rtems_set_errno_and_return_minus_one( eno);
     1106    rtems_ftpfs_terminate(iop, true);
     1107
     1108    rtems_set_errno_and_return_minus_one(eno);
    11001109  }
    11011110}
     
    11181127
    11191128  while (todo > 0) {
    1120     ssize_t rv = recv( e->data_socket, in, todo, 0);
     1129    ssize_t rv = recv(e->data_socket, in, todo, 0);
    11211130
    11221131    if (rv <= 0) {
    11231132      if (rv == 0) {
    11241133        rtems_ftpfs_reply reply =
    1125           rtems_ftpfs_get_reply( e->ctrl_socket, NULL, NULL, verbose);
     1134          rtems_ftpfs_get_reply(e->ctrl_socket, NULL, NULL, verbose);
    11261135
    11271136        if (reply == RTEMS_FTPFS_REPLY_2) {
     
    11311140      }
    11321141
    1133       rtems_set_errno_and_return_minus_one( EIO);
     1142      rtems_set_errno_and_return_minus_one(EIO);
    11341143    }
    11351144
     
    11521161
    11531162  while (todo > 0) {
    1154     ssize_t rv = send( e->data_socket, out, todo, 0);
     1163    ssize_t rv = send(e->data_socket, out, todo, 0);
    11551164
    11561165    if (rv <= 0) {
     
    11581167        break;
    11591168      } else {
    1160         rtems_set_errno_and_return_minus_one( EIO);
     1169        rtems_set_errno_and_return_minus_one(EIO);
    11611170      }
    11621171    }
     
    11691178}
    11701179
    1171 static int rtems_ftpfs_close( rtems_libio_t *iop)
    1172 {
    1173   int eno = rtems_ftpfs_terminate( iop, false);
     1180static int rtems_ftpfs_close(rtems_libio_t *iop)
     1181{
     1182  int eno = rtems_ftpfs_terminate(iop, false);
    11741183
    11751184  if (eno == 0) {
    11761185    return 0;
    11771186  } else {
    1178     rtems_set_errno_and_return_minus_one( eno);
    1179   }
    1180 }
    1181 
    1182 /* Dummy version to let fopen( *,"w") work properly */
    1183 static int rtems_ftpfs_ftruncate( rtems_libio_t *iop, rtems_off64_t count)
     1187    rtems_set_errno_and_return_minus_one(eno);
     1188  }
     1189}
     1190
     1191/* Dummy version to let fopen(*,"w") work properly */
     1192static int rtems_ftpfs_ftruncate(rtems_libio_t *iop, rtems_off64_t count)
    11841193{
    11851194  return 0;
     
    11981207   * again.  The path is used in rtems_ftpfs_open() via iop->file_info.
    11991208   */
    1200   pathloc->node_access = malloc(pathnamelen + 1);
    1201   if (pathloc->node_access) {
    1202     memset(pathloc->node_access, 0, pathnamelen + 1);
    1203     memcpy(pathloc->node_access, pathname, pathnamelen);
    1204   }   
    1205   pathloc->node_access = strdup( pathname);
     1209  char *pathname_dup = malloc(pathnamelen + 1);
     1210
     1211  if (pathname_dup != NULL) {
     1212    memcpy(pathname_dup, pathname, pathnamelen);
     1213    pathname_dup [pathnamelen] = '\0';
     1214  }
     1215
     1216  pathloc->node_access = pathname_dup;
    12061217
    12071218  return 0;
    12081219}
    12091220
    1210 static int rtems_ftpfs_free_node( rtems_filesystem_location_info_t *pathloc)
    1211 {
    1212   free( pathloc->node_access);
     1221static int rtems_ftpfs_free_node(rtems_filesystem_location_info_t *pathloc)
     1222{
     1223  free(pathloc->node_access);
    12131224
    12141225  return 0;
     
    12261237)
    12271238{
    1228   rtems_ftpfs_mount_entry *me = malloc( sizeof( rtems_ftpfs_mount_entry));
     1239  rtems_ftpfs_mount_entry *me = malloc(sizeof(rtems_ftpfs_mount_entry));
    12291240
    12301241  /* Mount entry for FTP file system instance */
    12311242  e->fs_info = me;
    12321243  if (e->fs_info == NULL) {
    1233     rtems_set_errno_and_return_minus_one( ENOMEM);
     1244    rtems_set_errno_and_return_minus_one(ENOMEM);
    12341245  }
    12351246  me->verbose = false;
     
    12541265)
    12551266{
    1256   free( e->fs_info);
     1267  free(e->fs_info);
    12571268
    12581269  return 0;
     
    12701281
    12711282  if (arg == NULL) {
    1272     rtems_set_errno_and_return_minus_one( EINVAL);
     1283    rtems_set_errno_and_return_minus_one(EINVAL);
    12731284  }
    12741285
     
    13061317  static unsigned ino = 0;
    13071318
    1308   memset( st, 0, sizeof( *st));
     1319  memset(st, 0, sizeof(*st));
    13091320
    13101321  /* FIXME */
    13111322  st->st_ino = ++ino;
    1312   st->st_dev = rtems_filesystem_make_dev_t( 0xcc494cd6U, 0x1d970b4dU);
     1323  st->st_dev = rtems_filesystem_make_dev_t(0xcc494cd6U, 0x1d970b4dU);
    13131324
    13141325  st->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
Note: See TracChangeset for help on using the changeset viewer.