Check-in [a81fdbceed]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added win32 winsock initialization routines
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a81fdbceedda8182ad2a3d12d7ce926f5d212db7
User & Date: rkeene 2008-11-15 17:55:40
Context
2012-07-19
05:25
Updated to use newer mingw32 conventions Leaf check-in: 25f65515cc user: rkeene tags: trunk
2008-11-15
17:55
Added win32 winsock initialization routines check-in: a81fdbceed user: rkeene tags: trunk
13:04
Updated ignores, and updated header includes to support win32 check-in: 22df989e88 user: rkeene tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tools/file_sync-standalone.c.

57
58
59
60
61
62
63

64
65
66
67
68
69
70
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#if defined(__WIN32__) && !defined(__CYGWIN__)

#include <windows.h>
#else
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#endif







>







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <time.h>
#if defined(__WIN32__) && !defined(__CYGWIN__)
#define _USE_WIN32_ 1
#include <windows.h>
#else
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#endif
661
662
663
664
665
666
667














668
669
670
671
672
673
674

int main(int argc, char **argv) {
	char *mode, *host, *port_str, *file, *blocksize_str;
	uint32_t blocksize;
	int func_ret;
	int retval = EXIT_SUCCESS;
	int port;















	if (argc < 2) {
		return(print_help(EXIT_FAILURE));
	}

#ifdef HAVE_SIGNAL
#ifdef SIGPIPE







>
>
>
>
>
>
>
>
>
>
>
>
>
>







662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689

int main(int argc, char **argv) {
	char *mode, *host, *port_str, *file, *blocksize_str;
	uint32_t blocksize;
	int func_ret;
	int retval = EXIT_SUCCESS;
	int port;

#ifdef _USE_WIN32_
	WSADATA wsaData;

	if (WSAStartup(MAKEWORD(2, 0), &wsaData) == 0) {
		if (wsaData.wVersion != MAKEWORD(2, 0)) {
			/* Cleanup Winsock stuff */
			WSACleanup();
			fprintf(stderr, "ERROR: Failed to initialize Winsock, aborting...\n");
			return(EXIT_FAILURE);
		}
	}
#endif


	if (argc < 2) {
		return(print_help(EXIT_FAILURE));
	}

#ifdef HAVE_SIGNAL
#ifdef SIGPIPE