Imported from ../bash-2.05b.tar.gz.
This commit is contained in:
parent
f73dda092b
commit
7117c2d221
362 changed files with 34387 additions and 15063 deletions
|
|
@ -1,7 +1,7 @@
|
|||
This file is fg_bg.def, from which is created fg_bg.c.
|
||||
It implements the builtins "bg" and "fg" in Bash.
|
||||
|
||||
Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
|
|
@ -42,6 +42,7 @@ $END
|
|||
#include "../shell.h"
|
||||
#include "../jobs.h"
|
||||
#include "common.h"
|
||||
#include "bashgetopt.h"
|
||||
|
||||
#if defined (JOB_CONTROL)
|
||||
extern char *this_command_name;
|
||||
|
|
@ -58,12 +59,13 @@ fg_builtin (list)
|
|||
|
||||
if (job_control == 0)
|
||||
{
|
||||
builtin_error ("no job control");
|
||||
sh_nojobs ((char *)NULL);
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
if (no_options (list))
|
||||
return (EX_USAGE);
|
||||
list = loptend;
|
||||
|
||||
/* If the last arg on the line is '&', then start this job in the
|
||||
background. Else, fg the job. */
|
||||
|
|
@ -92,12 +94,13 @@ bg_builtin (list)
|
|||
{
|
||||
if (job_control == 0)
|
||||
{
|
||||
builtin_error ("no job control");
|
||||
sh_nojobs ((char *)NULL);
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
if (no_options (list))
|
||||
return (EX_USAGE);
|
||||
list = loptend;
|
||||
|
||||
return (fg_bg (list, 0));
|
||||
}
|
||||
|
|
@ -117,7 +120,7 @@ fg_bg (list, foreground)
|
|||
if (job < 0 || job >= job_slots || jobs[job] == 0)
|
||||
{
|
||||
if (job != DUP_JOB)
|
||||
builtin_error ("%s: no such job", list ? list->word->word : "current");
|
||||
sh_badjob (list ? list->word->word : "current");
|
||||
|
||||
goto failure;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue