Changeset 89c57b6 in mainline for uspace/app/ping/ping.c


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/ping/ping.c

    rcefb126 r89c57b6  
    3535 */
    3636
     37#include <async.h>
    3738#include <stdio.h>
    3839#include <str.h>
    3940#include <task.h>
    4041#include <time.h>
    41 #include <ipc/ipc.h>
    4242#include <ipc/services.h>
    4343#include <str_error.h>
     44#include <errno.h>
    4445#include <arg_parse.h>
    4546
    46 #include <icmp_api.h>
    47 #include <in.h>
    48 #include <in6.h>
    49 #include <inet.h>
    50 #include <ip_codes.h>
    51 #include <socket_errno.h>
    52 #include <socket_parse.h>
     47#include <net/icmp_api.h>
     48#include <net/in.h>
     49#include <net/in6.h>
     50#include <net/inet.h>
     51#include <net/socket_parse.h>
     52#include <net/ip_codes.h>
    5353
    5454#include "print_error.h"
     
    337337        }
    338338       
    339         printf("PING %s (%s) %u(%u) bytes of data\n", config.dest_addr,
     339        printf("PING %s (%s) %zu(%zu) bytes of data\n", config.dest_addr,
    340340            config.dest_str, config.size, config.size);
    341341       
    342         int icmp_phone = icmp_connect_module(SERVICE_ICMP, ICMP_CONNECT_TIMEOUT);
     342        int icmp_phone = icmp_connect_module(ICMP_CONNECT_TIMEOUT);
    343343        if (icmp_phone < 0) {
    344344                fprintf(stderr, "%s: Unable to connect to ICMP service (%s)\n", NAME,
     
    355355                            str_error(ret));
    356356                       
    357                         ipc_hangup(icmp_phone);
     357                        async_hangup(icmp_phone);
    358358                        return ret;
    359359                }
     
    370370                            str_error(ret));
    371371                       
    372                         ipc_hangup(icmp_phone);
     372                        async_hangup(icmp_phone);
    373373                        return ret;
    374374                }
     
    378378                switch (result) {
    379379                case ICMP_ECHO:
    380                         printf("%u bytes from ? (?): icmp_seq=%u ttl=? time=%u.%04u\n",
     380                        printf("%zu bytes from ? (?): icmp_seq=%u ttl=? time=%ld.%04ld\n",
    381381                                config.size, seq, elapsed / 1000, elapsed % 1000);
    382382                        break;
    383383                case ETIMEOUT:
    384                         printf("%u bytes from ? (?): icmp_seq=%u Timed out\n",
     384                        printf("%zu bytes from ? (?): icmp_seq=%u Timed out\n",
    385385                                config.size, seq);
    386386                        break;
     
    390390        }
    391391       
    392         ipc_hangup(icmp_phone);
     392        async_hangup(icmp_phone);
    393393       
    394394        return 0;
Note: See TracChangeset for help on using the changeset viewer.