summaryrefslogtreecommitdiffstats
path: root/bin/sh/jobs.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-10-13 13:22:11 +0000
committerjhb <jhb@FreeBSD.org>2010-10-13 13:22:11 +0000
commitec1e5e05cc237d3c9ee0347bb2c933191e5844f5 (patch)
treeb634dab3d26fd2ec335e2892af245cea71bea502 /bin/sh/jobs.c
parent630d6005f9fbb903a2005ffd4cf2bf1a72a65609 (diff)
downloadFreeBSD-src-ec1e5e05cc237d3c9ee0347bb2c933191e5844f5.zip
FreeBSD-src-ec1e5e05cc237d3c9ee0347bb2c933191e5844f5.tar.gz
Make DEBUG traces 64-bit clean:
- Use %t to print ptrdiff_t values. - Cast a ptrdiff_t value explicitly to int for a field width specifier. While here, sort includes. Submitted by: Garrett Cooper
Diffstat (limited to 'bin/sh/jobs.c')
-rw-r--r--bin/sh/jobs.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index 7740302..7540742 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -38,18 +38,18 @@ static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <fcntl.h>
-#include <signal.h>
-#include <errno.h>
-#include <paths.h>
-#include <unistd.h>
-#include <stdlib.h>
+#include <sys/ioctl.h>
#include <sys/param.h>
-#include <sys/wait.h>
-#include <sys/time.h>
#include <sys/resource.h>
+#include <sys/stddef.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <fcntl.h>
#include <paths.h>
-#include <sys/ioctl.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
#include "shell.h"
#if JOBS
@@ -680,7 +680,7 @@ makejob(union node *node __unused, int nprocs)
jp->ps = &jp->ps0;
}
INTON;
- TRACE(("makejob(%p, %d) returns %%%d\n", (void *)node, nprocs,
+ TRACE(("makejob(%p, %d) returns %%%td\n", (void *)node, nprocs,
jp - jobtab + 1));
return jp;
}
@@ -766,7 +766,7 @@ forkshell(struct job *jp, union node *n, int mode)
pid_t pid;
pid_t pgrp;
- TRACE(("forkshell(%%%d, %p, %d) called\n", jp - jobtab, (void *)n,
+ TRACE(("forkshell(%%%td, %p, %d) called\n", jp - jobtab, (void *)n,
mode));
INTOFF;
if (mode == FORK_BG)
@@ -903,7 +903,7 @@ waitforjob(struct job *jp, int *origstatus)
int st;
INTOFF;
- TRACE(("waitforjob(%%%d) called\n", jp - jobtab + 1));
+ TRACE(("waitforjob(%%%td) called\n", jp - jobtab + 1));
while (jp->state == 0)
if (dowait(1, jp) == -1)
dotrap();
@@ -1004,7 +1004,7 @@ dowait(int block, struct job *job)
if (stopped) { /* stopped or done */
int state = done? JOBDONE : JOBSTOPPED;
if (jp->state != state) {
- TRACE(("Job %d: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state));
+ TRACE(("Job %td: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state));
jp->state = state;
if (jp != job) {
if (done && !jp->remembered &&
OpenPOWER on IntegriCloud