- {
- fprintf (stderr, "There are stopped jobs.\n");
-
- /* This is NOT superfluous because EOF can get here without
- going through the command parser. Set both last and this
- so that either `exit', `logout', or ^D will work to exit
- immediately if nothing intervenes. */
- this_shell_builtin = last_shell_builtin = exit_builtin;
- return (EXECUTION_FAILURE);
- }
+ stopmsg = JSTOPPED;
+ else if (check_jobs_at_exit && stopmsg == 0 && RUNNING (i))
+ stopmsg = JRUNNING;
+
+ if (stopmsg == JSTOPPED)
+ fprintf (stderr, _("There are stopped jobs.\n"));
+ else if (stopmsg == JRUNNING)
+ fprintf (stderr, _("There are running jobs.\n"));
+
+ if (stopmsg && check_jobs_at_exit)
+ list_all_jobs (JLIST_STANDARD);
+
+ if (stopmsg)
+ {
+ /* This is NOT superfluous because EOF can get here without
+ going through the command parser. Set both last and this
+ so that either `exit', `logout', or ^D will work to exit
+ immediately if nothing intervenes. */
+ this_shell_builtin = last_shell_builtin = exit_builtin;
+ return (EXECUTION_FAILURE);
+ }