~ubuntu-branches/ubuntu/precise/bsd-mailx/precise-updates

« back to all changes in this revision

Viewing changes to cmd2.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-11-10 00:07:07 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091110000707-5y4euwu6nxg7jj8j
Tags: 8.1.2-0.20090911cvs-2ubuntu1
* Merge from Debian testing, remaining changes:
  - Use default-mta as the default MTA instead of exim4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $OpenBSD: cmd2.c,v 1.15 2004/09/15 22:21:40 deraadt Exp $       */
 
1
/*      $OpenBSD: cmd2.c,v 1.16 2009/07/28 16:05:04 martynas Exp $      */
2
2
/*      $NetBSD: cmd2.c,v 1.7 1997/05/17 19:55:10 pk Exp $      */
3
3
 
4
4
/*
34
34
#if 0
35
35
static const char sccsid[] = "@(#)cmd2.c        8.1 (Berkeley) 6/6/93";
36
36
#else
37
 
static const char rcsid[] = "$OpenBSD: cmd2.c,v 1.15 2004/09/15 22:21:40 deraadt Exp $";
 
37
static const char rcsid[] = "$OpenBSD: cmd2.c,v 1.16 2009/07/28 16:05:04 martynas Exp $";
38
38
#endif
39
39
#endif /* not lint */
40
40
 
347
347
}
348
348
 
349
349
/*
350
 
 * Interactively dump core on "core"
351
 
 */
352
 
int
353
 
core(void *v)
354
 
{
355
 
        pid_t pid;
356
 
        extern int wait_status;
357
 
 
358
 
        switch (pid = vfork()) {
359
 
        case -1:
360
 
                warn("vfork");
361
 
                return(1);
362
 
        case 0:
363
 
                abort();
364
 
                _exit(1);
365
 
        }
366
 
        fputs("Okie dokie", stdout);
367
 
        fflush(stdout);
368
 
        wait_child(pid);
369
 
        if (WIFSIGNALED(wait_status) && WCOREDUMP(wait_status))
370
 
                puts(" -- Core dumped.");
371
 
        else
372
 
                puts(" -- Can't dump core.");
373
 
        return(0);
374
 
}
375
 
 
376
 
/*
377
350
 * Add the given header fields to the retained list.
378
351
 * If no arguments, print the current list of retained fields.
379
352
 */