~ubuntu-branches/ubuntu/hoary/courier/hoary

« back to all changes in this revision

Viewing changes to courier/libs/comsubmitclient.c

  • Committer: Bazaar Package Importer
  • Author(s): Thom May
  • Date: 2004-11-29 12:09:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041129120934-kkn0xj11j0n1n6lo
Tags: 0.47-3ubuntu1
* Nathaniel McCallum
 - debian/*.init: pretty initscripts
 - debian/control: version depends on lsb-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include        <signal.h>
24
24
 
25
25
static void (*printfunc)(const char *);
 
26
static void (*teergrubefunc)(void)=NULL;
 
27
 
26
28
static pid_t submit_pid;
27
29
FILE *submit_to;
28
30
FILE *fromsubmit;
44
46
#endif
45
47
}
46
48
 
 
49
void submit_set_teergrube( void (*funcarg)(void))
 
50
{
 
51
        teergrubefunc=funcarg;
 
52
}
 
53
 
47
54
/*
48
55
** Wait for the submit process to terminate.  NOTE: submit_to must be
49
56
** already closed.  Returns 0 if submit terminated normally, non-zero
207
214
 
208
215
static int read_resp_oneline(char *errcode, int doprint)
209
216
{
210
 
static char linebuf[BUFSIZ];
211
 
char    *c;
212
 
int     rc;
 
217
        static char linebuf[BUFSIZ];
 
218
        char    *c;
 
219
        int     rc;
 
220
        char    prev_errcode=errcode[0];
213
221
 
214
222
        if (submit_error ||
215
223
                fgets(linebuf, sizeof(linebuf), fromsubmit) == NULL)
283
291
                        doprint=0;
284
292
                break;
285
293
        default:
 
294
                if (prev_errcode == 0 && errcode[0] == '5' &&
 
295
                    teergrubefunc)
 
296
                {
 
297
                        (*teergrubefunc)();
 
298
                }
 
299
 
286
300
                if (log_error_prefix_func)
287
301
                {
288
302
                        clog_msg_start_err();