~ubuntu-branches/ubuntu/natty/gnupg2/natty

« back to all changes in this revision

Viewing changes to keyserver/gpgkeys_finger.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-03-08 22:46:47 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090308224647-gq17gatcl71lrc2k
Tags: 2.0.11-1
* New upstream release. (Closes: #496663)
* debian/control: Make the description a little more distinctive than
  gnupg v1's. Thanks Jari Aalto. (Closes: #496323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <getopt.h>
28
28
#endif
29
29
 
30
 
#ifdef _WIN32
 
30
#ifdef HAVE_W32_SYSTEM
31
31
#include <windows.h>
32
32
#else
33
33
#include <unistd.h>
46
46
#include "ksutil.h"
47
47
#include "iobuf.h"
48
48
 
49
 
#ifdef _WIN32
 
49
#ifdef HAVE_W32_SYSTEM
50
50
#define sock_close(a)  closesocket(a)
51
51
#else
52
52
#define sock_close(a)  close(a)
58
58
static FILE *input,*output,*console;
59
59
static struct ks_options *opt;
60
60
 
61
 
#ifdef _WIN32
62
 
static void
63
 
deinit_sockets (void)
64
 
{
65
 
  WSACleanup();
66
 
}
67
 
 
68
 
static void
69
 
init_sockets (void)
70
 
{
71
 
  static int initialized;
72
 
  static WSADATA wsdata;
73
 
 
74
 
  if (initialized)
75
 
    return;
76
 
 
77
 
  if (WSAStartup (0x0101, &wsdata) )
78
 
    {
79
 
      fprintf (console, "error initializing socket library: ec=%d\n", 
80
 
               (int)WSAGetLastError () );
81
 
      return;
82
 
    }
83
 
  if (wsdata.wVersion < 0x0001)
84
 
    {
85
 
      fprintf (console, "socket library version is %x.%x - but 1.1 needed\n",
86
 
               LOBYTE(wsdata.wVersion), HIBYTE(wsdata.wVersion));
87
 
      WSACleanup();
88
 
      return;
89
 
    }
90
 
  atexit  (deinit_sockets);
91
 
  initialized = 1;
92
 
}
93
 
#endif /*_WIN32*/
94
 
 
95
61
 
96
62
/* Connect to SERVER at PORT and return a file descriptor or -1 on
97
63
   error. */
100
66
{
101
67
  int sock = -1;
102
68
 
103
 
#ifdef _WIN32
 
69
#ifdef HAVE_W32_SYSTEM
104
70
  struct hostent *hp;
105
71
  struct sockaddr_in addr;
106
72
  unsigned long l;
107
73
 
108
 
  init_sockets ();
 
74
  w32_init_sockets ();
109
75
 
110
76
  memset (&addr, 0, sizeof addr);
111
77
  addr.sin_family = AF_INET;
201
167
    {
202
168
      int nwritten;
203
169
      
204
 
#ifdef _WIN32  
 
170
#ifdef HAVE_W32_SYSTEM  
205
171
      nwritten = send (sock, data, nleft, 0);
206
172
      if ( nwritten == SOCKET_ERROR )
207
173
        {