~csurbhi/ubuntu/maverick/e2fsprogs/e2fsprogs.fix-505719

« back to all changes in this revision

Viewing changes to lib/ss/error.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-09-19 09:43:14 UTC
  • mto: (8.1.1 lenny) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040919094314-2tafd19i76fhu6ei
Tags: upstream-1.35
ImportĀ upstreamĀ versionĀ 1.35

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
#include <stdio.h>
16
16
 
17
 
/*
18
 
 * I'm assuming that com_err.h includes varargs.h, which it does
19
 
 * (right now).  There really ought to be a way for me to include the
20
 
 * file without worrying about whether com_err.h includes it or not,
21
 
 * but varargs.h doesn't define anything that I can use as a flag, and
22
 
 * gcc will lose if I try to include it twice and redefine stuff.
23
 
 */
24
 
#if !defined(__STDC__) || !defined(ibm032) || !defined(NeXT)
25
 
#define ss_error ss_error_external
26
 
#endif
27
 
 
28
17
#include <com_err.h>
29
18
#include "ss_internal.h"
30
19
 
31
 
#ifdef HAVE_STDARG_H
32
20
#include <stdarg.h>
33
 
#else
34
 
#include <vararg.h>
35
 
#endif
36
21
  
37
 
#undef ss_error
38
 
 
39
22
char * ss_name(sci_idx)
40
23
    int sci_idx;
41
24
{
74
57
    }
75
58
}
76
59
 
77
 
#ifdef HAVE_STDARG_H
78
60
void ss_error (int sci_idx, long code, const char * fmt, ...)
79
 
#else
80
 
void ss_error (va_alist)
81
 
    va_dcl
82
 
#endif
83
61
{
84
62
    register char *whoami;
85
63
    va_list pvar;
86
 
#ifndef HAVE_STDARG_H
87
 
    int sci_idx;
88
 
    long code;
89
 
    char * fmt;
90
 
    va_start (pvar);
91
 
    sci_idx = va_arg (pvar, int);
92
 
    code = va_arg (pvar, long);
93
 
    fmt = va_arg (pvar, char *);
94
 
#else
 
64
 
95
65
    va_start (pvar, fmt);
96
 
#endif
97
66
    whoami = ss_name (sci_idx);
98
67
    com_err_va (whoami, code, fmt, pvar);
99
68
    free (whoami);