~ubuntu-branches/ubuntu/vivid/sup/vivid

« back to all changes in this revision

Viewing changes to quit.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-06-03 10:52:06 UTC
  • Revision ID: james.westby@ubuntu.com-20040603105206-gs0ru9r7st4s4ldm
Tags: upstream-1.8
ImportĀ upstreamĀ versionĀ 1.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 1991 Carnegie Mellon University
 
3
 * All Rights Reserved.
 
4
 * 
 
5
 * Permission to use, copy, modify and distribute this software and its
 
6
 * documentation is hereby granted, provided that both the copyright
 
7
 * notice and this permission notice appear in all copies of the
 
8
 * software, derivative works or modified versions, and any portions
 
9
 * thereof, and that both notices appear in supporting documentation.
 
10
 *
 
11
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 
12
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 
13
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 
14
 *
 
15
 * Carnegie Mellon requests users of this software to return to
 
16
 *
 
17
 *  Software Distribution Coordinator   or   Software.Distribution@CS.CMU.EDU
 
18
 *  School of Computer Science
 
19
 *  Carnegie Mellon University
 
20
 *  Pittsburgh PA 15213-3890
 
21
 *
 
22
 * any improvements or extensions that they make and grant Carnegie the rights
 
23
 * to redistribute these changes.
 
24
 */
 
25
/*
 
26
 *  quit  --  print message and exit
 
27
 *
 
28
 *  Usage:  quit (status,format [,arg]...);
 
29
 *      int status;
 
30
 *      (... format and arg[s] make up a printf-arglist)
 
31
 *
 
32
 *  Quit is a way to easily print an arbitrary message and exit.
 
33
 *  It is most useful for error exits from a program:
 
34
 *      if (open (...) < 0) then quit (1,"Can't open...",file);
 
35
 *
 
36
 **********************************************************************
 
37
 * HISTORY
 
38
 * $Log: quit.c,v $
 
39
 * Revision 1.1.1.1  1993/08/21  00:46:33  jkh
 
40
 * Current sup with compression support.
 
41
 *
 
42
 * Revision 1.1.1.1  1993/05/21  14:52:17  cgd
 
43
 * initial import of CMU's SUP to NetBSD
 
44
 *
 
45
 * Revision 1.2  88/12/13  13:52:41  gm0w
 
46
 *      Rewritten to use varargs.
 
47
 *      [88/12/13            gm0w]
 
48
 * 
 
49
 **********************************************************************
 
50
 */
 
51
 
 
52
#include <stdio.h>
 
53
#include <varargs.h>
 
54
 
 
55
quit (status, fmt, va_alist)
 
56
int status;
 
57
char *fmt;
 
58
va_dcl
 
59
{
 
60
        va_list args;
 
61
 
 
62
        fflush(stdout);
 
63
        va_start(args);
 
64
        (void) vfprintf(stderr, fmt, args);
 
65
        va_end(args);
 
66
        exit(status);
 
67
}