2
2
3
3
/*-
4
4
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011,
5
- * 2012, 2013, 2014, 2015, 2016
5
+ * 2012, 2013, 2014, 2015, 2016, 2018
6
6
* mirabilos <m@mirbsd.org>
7
7
*
8
8
* Provided that these terms and disclaimer and all copyright notices
23
23
24
24
#include "sh.h"
25
25
26
- __RCSID ("$MirOS: src/bin/mksh/jobs.c,v 1.124 2017/08/08 14:30:10 tg Exp $" );
26
+ __RCSID ("$MirOS: src/bin/mksh/jobs.c,v 1.125 2018/01/05 20:08:34 tg Exp $" );
27
27
28
28
#if HAVE_KILLPG
29
29
#define mksh_killpg killpg
@@ -1545,7 +1545,9 @@ j_print(Job *j, int how, struct shf *shf)
1545
1545
Proc * p ;
1546
1546
int state ;
1547
1547
int status ;
1548
+ #ifdef WCOREDUMP
1548
1549
bool coredumped ;
1550
+ #endif
1549
1551
char jobchar = ' ' ;
1550
1552
char buf [64 ];
1551
1553
const char * filler ;
@@ -1569,7 +1571,9 @@ j_print(Job *j, int how, struct shf *shf)
1569
1571
jobchar = '-' ;
1570
1572
1571
1573
for (p = j -> proc_list ; p != NULL ;) {
1574
+ #ifdef WCOREDUMP
1572
1575
coredumped = false;
1576
+ #endif
1573
1577
switch (p -> state ) {
1574
1578
case PRUNNING :
1575
1579
memcpy (buf , "Running" , 8 );
@@ -1603,7 +1607,10 @@ j_print(Job *j, int how, struct shf *shf)
1603
1607
* kludge for not reporting 'normal termination
1604
1608
* signals' (i.e. SIGINT, SIGPIPE)
1605
1609
*/
1606
- if (how == JP_SHORT && !coredumped &&
1610
+ if (how == JP_SHORT &&
1611
+ #ifdef WCOREDUMP
1612
+ !coredumped &&
1613
+ #endif
1607
1614
(termsig == SIGINT || termsig == SIGPIPE )) {
1608
1615
buf [0 ] = '\0' ;
1609
1616
} else
@@ -1629,14 +1636,22 @@ j_print(Job *j, int how, struct shf *shf)
1629
1636
if (how == JP_SHORT ) {
1630
1637
if (buf [0 ]) {
1631
1638
output = 1 ;
1639
+ #ifdef WCOREDUMP
1632
1640
shf_fprintf (shf , "%s%s " ,
1633
1641
buf , coredumped ? " (core dumped)" : null );
1642
+ #else
1643
+ shf_puts (buf , shf );
1644
+ shf_putchar (' ' , shf );
1645
+ #endif
1634
1646
}
1635
1647
} else {
1636
1648
output = 1 ;
1637
1649
shf_fprintf (shf , "%-20s %s%s%s" , buf , p -> command ,
1638
1650
p -> next ? "|" : null ,
1639
- coredumped ? " (core dumped)" : null );
1651
+ #ifdef WCOREDUMP
1652
+ coredumped ? " (core dumped)" :
1653
+ #endif
1654
+ null );
1640
1655
}
1641
1656
1642
1657
state = p -> state ;
0 commit comments