Annotation of embedaddon/lrzsz/src/canit.c, revision 1.1.1.1

1.1       misho       1: /*
                      2:   canit - cancel zmodem connection 
                      3:   Copyright (C) until 1988 Chuck Forsberg (Omen Technology INC)
                      4:   Copyright (C) 1994 Matt Porter, Michael D. Black
                      5:   Copyright (C) 1996, 1997 Uwe Ohse
                      6: 
                      7:   This program is free software; you can redistribute it and/or modify
                      8:   it under the terms of the GNU General Public License as published by
                      9:   the Free Software Foundation; either version 2, or (at your option)
                     10:   any later version.
                     11: 
                     12:   This program is distributed in the hope that it will be useful,
                     13:   but WITHOUT ANY WARRANTY; without even the implied warranty of
                     14:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     15:   GNU General Public License for more details.
                     16: 
                     17:   You should have received a copy of the GNU General Public License
                     18:   along with this program; if not, write to the Free Software
                     19:   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
                     20:   02111-1307, USA.
                     21: */
                     22: #include "zglobal.h"
                     23: 
                     24: #define SS_NORMAL 0
                     25: #include <stdio.h>
                     26: #include <stdlib.h>
                     27: #include <signal.h>
                     28: #include <setjmp.h>
                     29: #include <ctype.h>
                     30: #include <errno.h>
                     31: #include <getopt.h>
                     32: 
                     33: /* send cancel string to get the other end to shut up */
                     34: void
                     35: canit (int fd)
                     36: {
                     37:        static char canistr[] =
                     38:        {
                     39:                24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 0
                     40:        };
                     41:        purgeline(fd);
                     42:        write(fd,canistr,strlen(canistr));
                     43:        if (fd==0)
                     44:                write(1,canistr,strlen(canistr));
                     45: }
                     46: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>