Clean up some logic.

This commit is contained in:
Paul Smith 1999-04-13 02:28:27 +00:00
parent a2ea1bd27f
commit 7f3ffd4019

62
main.c
View file

@ -1564,41 +1564,39 @@ int main (int argc, char ** argv)
else else
lastgoal->next = 0; lastgoal->next = 0;
if (goals != 0) if (!goals)
{ {
/* Update the goals. */ if (read_makefiles == 0)
fatal (NILF, "No targets specified and no makefile found");
if (debug_flag) fatal (NILF, "No targets");
puts ("Updating goal targets...."); }
switch (update_goal_chain (goals, 0)) /* Update the goals. */
{
case -1: if (debug_flag)
/* Nothing happened. */ puts ("Updating goal targets....");
case 0:
/* Updated successfully. */ switch (update_goal_chain (goals, 0))
status = EXIT_SUCCESS; {
break; case -1:
case 2: /* Nothing happened. */
/* Updating failed. POSIX.2 specifies exit status >1 for this; case 0:
but in VMS, there is only success and failure. */ /* Updated successfully. */
status = EXIT_FAILURE ? 2 : EXIT_FAILURE; status = EXIT_SUCCESS;
break; break;
case 1: case 2:
/* We are under -q and would run some commands. */ /* Updating failed. POSIX.2 specifies exit status >1 for this;
status = EXIT_FAILURE; but in VMS, there is only success and failure. */
break; status = EXIT_FAILURE ? 2 : EXIT_FAILURE;
default: break;
abort (); case 1:
} /* We are under -q and would run some commands. */
} status = EXIT_FAILURE;
else break;
{ default:
if (read_makefiles == 0) abort ();
fatal (NILF, "No targets specified and no makefile found"); }
else
fatal (NILF, "No targets");
}
/* If we detected some clock skew, generate one last warning */ /* If we detected some clock skew, generate one last warning */
if (clock_skew_detected) if (clock_skew_detected)