app: return EXIT_FAILURE when failing to pass the batch commands to…

… the main instance.

Note that it doesn't say if the batch command succeded, only if they were
successfuly communicated to the main process for processing.
This commit is contained in:
Jehan 2023-06-12 01:17:20 +02:00
parent eb0ee5f33a
commit 7c1fb5bc67
1 changed files with 6 additions and 3 deletions

View File

@ -767,16 +767,19 @@ main (int argc,
#ifndef GIMP_CONSOLE_COMPILATION
if (! new_instance && gimp_unique_open (filenames, as_new))
{
int success = EXIT_SUCCESS;
if (be_verbose)
g_print ("%s\n",
_("Another GIMP instance is already running."));
if (batch_commands)
gimp_unique_batch_run (batch_interpreter, batch_commands);
if (batch_commands &&
! gimp_unique_batch_run (batch_interpreter, batch_commands))
success = EXIT_FAILURE;
gdk_notify_startup_complete ();
return EXIT_SUCCESS;
return success;
}
#endif