~ubuntu-branches/ubuntu/maverick/openssl/maverick

« back to all changes in this revision

Viewing changes to crypto/ui/ui_openssl.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2005-12-13 21:37:42 UTC
  • mto: (11.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051213213742-d0ydaylf80l16bj1
Tags: upstream-0.9.8a
ImportĀ upstreamĀ versionĀ 0.9.8a

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
 
118
118
#include <openssl/e_os2.h>
119
119
 
 
120
/* need for #define _POSIX_C_SOURCE arises whenever you pass -ansi to gcc
 
121
 * [maybe others?], because it masks interfaces not discussed in standard,
 
122
 * sigaction and fileno included. -pedantic would be more appropriate for
 
123
 * the intended purposes, but we can't prevent users from adding -ansi.
 
124
 */
 
125
#define _POSIX_C_SOURCE 1
 
126
#include <signal.h>
 
127
#include <stdio.h>
 
128
#include <string.h>
 
129
#include <errno.h>
 
130
 
120
131
#if !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS)
121
132
# ifdef OPENSSL_UNISTD
122
133
#  include OPENSSL_UNISTD
145
156
/* 06-Apr-92 Luke Brennan    Support for VMS */
146
157
#include "ui_locl.h"
147
158
#include "cryptlib.h"
148
 
#include <signal.h>
149
 
#include <stdio.h>
150
 
#include <string.h>
151
 
#include <errno.h>
152
159
 
153
160
#ifdef OPENSSL_SYS_VMS          /* prototypes for sys$whatever */
154
161
# include <starlet.h>
199
206
#undef SGTTY
200
207
#endif
201
208
 
 
209
#if defined(OPENSSL_SYS_NETWARE)
 
210
#undef TERMIOS
 
211
#undef TERMIO
 
212
#undef SGTTY
 
213
#endif
 
214
 
202
215
#ifdef TERMIOS
203
216
# include <termios.h>
204
217
# define TTY_STRUCT             struct termios
247
260
        typedef int sig_atomic_t;
248
261
#endif
249
262
 
250
 
#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE)
 
263
#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(MAC_OS_GUSI_SOURCE) || defined(OPENSSL_SYS_NETWARE)
251
264
/*
252
265
 * This one needs work. As a matter of fact the code is unoperational
253
266
 * and this is only a trick to get it compiled.
460
473
        CRYPTO_w_lock(CRYPTO_LOCK_UI);
461
474
        is_a_tty = 1;
462
475
 
463
 
#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS)
 
476
#if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_NETWARE)
464
477
        tty_in=stdin;
465
478
        tty_out=stderr;
466
479
#else
476
489
#endif
477
490
 
478
491
#if defined(TTY_get) && !defined(OPENSSL_SYS_VMS)
479
 
        if (TTY_get(fileno(tty_in),&tty_orig) == -1)
 
492
        if (TTY_get(fileno(tty_in),&tty_orig) == -1)
480
493
                {
481
494
#ifdef ENOTTY
482
495
                if (errno == ENOTTY)
565
578
/* Internal functions to handle signals and act on them */
566
579
static void pushsig(void)
567
580
        {
 
581
#ifndef OPENSSL_SYS_WIN32
568
582
        int i;
 
583
#endif
569
584
#ifdef SIGACTION
570
585
        struct sigaction sa;
571
586
 
573
588
        sa.sa_handler=recsig;
574
589
#endif
575
590
 
 
591
#ifdef OPENSSL_SYS_WIN32
 
592
        savsig[SIGABRT]=signal(SIGABRT,recsig);
 
593
        savsig[SIGFPE]=signal(SIGFPE,recsig);
 
594
        savsig[SIGILL]=signal(SIGILL,recsig);
 
595
        savsig[SIGINT]=signal(SIGINT,recsig);
 
596
        savsig[SIGSEGV]=signal(SIGSEGV,recsig);
 
597
        savsig[SIGTERM]=signal(SIGTERM,recsig);
 
598
#else
576
599
        for (i=1; i<NX509_SIG; i++)
577
600
                {
578
601
#ifdef SIGUSR1
593
616
                savsig[i]=signal(i,recsig);
594
617
#endif
595
618
                }
 
619
#endif
596
620
 
597
621
#ifdef SIGWINCH
598
622
        signal(SIGWINCH,SIG_DFL);
601
625
 
602
626
static void popsig(void)
603
627
        {
 
628
#ifdef OPENSSL_SYS_WIN32
 
629
        signal(SIGABRT,savsig[SIGABRT]);
 
630
        signal(SIGFPE,savsig[SIGFPE]);
 
631
        signal(SIGILL,savsig[SIGILL]);
 
632
        signal(SIGINT,savsig[SIGINT]);
 
633
        signal(SIGSEGV,savsig[SIGSEGV]);
 
634
        signal(SIGTERM,savsig[SIGTERM]);
 
635
#else
604
636
        int i;
605
 
 
606
637
        for (i=1; i<NX509_SIG; i++)
607
638
                {
608
639
#ifdef SIGUSR1
619
650
                signal(i,savsig[i]);
620
651
#endif
621
652
                }
 
653
#endif
622
654
        }
623
655
 
624
656
static void recsig(int i)