X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Fwget_src%2Fmain.c;h=9b5391f13c9e00c53103065934fc419db402ca77;hb=6f00be304598cbaac2ed145f4d2079574717e984;hp=69c9ab71e7028e9dd5f71fb8aba58535e5178c8c;hpb=11dbd684e9a3d907d43d71a3145205f1a86992fb;p=tpg%2Facess2.git diff --git a/Usermode/Applications/wget_src/main.c b/Usermode/Applications/wget_src/main.c index 69c9ab71..9b5391f1 100644 --- a/Usermode/Applications/wget_src/main.c +++ b/Usermode/Applications/wget_src/main.c @@ -11,6 +11,7 @@ #include #include #include +#include // _SysDebug enum eProcols { @@ -84,6 +85,12 @@ int main(int argc, char *argv[]) continue ; } + if( proto != PROTO_HTTP ) { + fprintf(stderr, "TODO: Support protocols other than HTTP\n"); + free(uri); + continue ; + } + rv = getaddrinfo(uri->Host, "http", NULL, &addrinfo); if( rv != 0 ) { fprintf(stderr, "Unable to resolve %s: %s\n", uri->Host, gai_strerror(rv)); @@ -158,7 +165,7 @@ int main(int argc, char *argv[]) if( state == 2 ) { _SysDebug("RXing %i bytes to '%s'", bytes_wanted, outfile); - int outfd = open(outfile, O_WR|O_CREAT, 0666); + int outfd = open(outfile, O_WRONLY|O_CREAT, 0666); if( outfd == -1 ) { fprintf(stderr, "Unable to open '%s' for writing\n", outfile); }