Deleted Added
sdiff udiff text old ( 263453 ) new ( 268920 )
full compact
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)jobs.c 8.5 (Berkeley) 5/4/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/bin/sh/jobs.c 263453 2014-03-20 22:38:13Z jilles $");
40
41#include <sys/ioctl.h>
42#include <sys/param.h>
43#include <sys/resource.h>
44#include <sys/time.h>
45#include <sys/wait.h>
46#include <errno.h>
47#include <fcntl.h>

--- 509 unchanged lines hidden (view full) ---

557 * Convert a job name to a job structure.
558 */
559
560static struct job *
561getjob_nonotfound(const char *name)
562{
563 int jobno;
564 struct job *found, *jp;
565 pid_t pid;
566 int i;
567
568 if (name == NULL) {
569#if JOBS
570currentjob: if ((jp = getcurjob(NULL)) == NULL)
571 error("No current job");
572 return (jp);

--- 25 unchanged lines hidden (view full) ---

598 if (found)
599 error("%s: ambiguous", name);
600 found = jp;
601 }
602 }
603 if (found != NULL)
604 return (found);
605 } else {
606 found = NULL;
607 for (jp = jobtab, i = njobs ; --i >= 0 ; jp++) {
608 if (jp->used && jp->nprocs > 0
609 && prefix(name + 1, jp->ps[0].cmd)) {
610 if (found)
611 error("%s: ambiguous", name);
612 found = jp;
613 }
614 }
615 if (found)
616 return found;
617 }

--- 852 unchanged lines hidden ---