~ubuntu-branches/ubuntu/feisty/gnupg2/feisty

« back to all changes in this revision

Viewing changes to jnlib/w32-afunix.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-11-24 18:48:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20061124184823-17ir9m46tl09n9k4
Tags: 2.0.0-4ubuntu1
* Synchronize to Debian, reapply remaining Ubuntu changes to pristine Debian
  version:
  - Remove libpcsclite-dev, libopensc2-dev build dependencies (they are in
    universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* w32-afunix.c
2
 
 * Copyright (C) 2004 g10 Code GmbH
3
 
 *
4
 
 * This file is part of GnuPG.
5
 
 *
6
 
 * GnuPG is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * GnuPG is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19
 
 * USA.
 
1
/* w32-afunix.c - AF_UNIX emulation for Windows.
 
2
 * Copyright (C) 2004, 2006 g10 Code GmbH
 
3
 *
 
4
 * This file is part of JNLIB.
 
5
 *
 
6
 * JNLIB is free software; you can redistribute it and/or modify it
 
7
 * under the terms of the GNU Lesser General Public License as
 
8
 * published by the Free Software Foundation; either version 2.1 of
 
9
 * the License, or (at your option) any later version.
 
10
 *
 
11
 * JNLIB is distributed in the hope that it will be useful, but
 
12
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 * Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public
 
17
 * License along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
19
 * 02110-1301, USA.
20
20
 */
 
21
 
21
22
#ifdef _WIN32
22
23
#include <stdio.h>
23
24
#include <windows.h>
24
25
#include <io.h>
 
26
#include <errno.h>
25
27
 
26
28
#include "w32-afunix.h"
27
29
 
59
61
  fscanf (fp, "%d", &port);
60
62
  fclose (fp);
61
63
 
62
 
  /* XXX: set errno in this case */
63
64
  if (port < 0 || port > 65535)
64
 
    return -1;
 
65
    {
 
66
      errno = EINVAL;
 
67
      return -1;
 
68
    }
65
69
  
66
70
  myaddr.sin_family = AF_INET;
67
71
  myaddr.sin_port = port;