1. TakUnity
  2. chg

Commits

TakUnity  committed b76a3b1

Shut down command server after executing a command with a custom --config option.

  • Participants
  • Parent commits 39e1800
  • Branches default

Comments (0)

Files changed (1)

File src/chg.c

View file
     hgc = hgc_open(envp);
     if (!hgc) abortmsg("cannot open hg client");
 
-    if (get_config_arguments (argc, argv)) {
+    int got_config_arguments = get_config_arguments (argc, argv);
+
+    if (got_config_arguments) {
         hgc_kill (hgc, SIGINT);
         hgc_close (hgc);
         // Give the server plenty of time to shut down and clean up
     setuppager(hgc, argv + 1, argc - 1);
 
     int exitcode = hgc_runcommand(hgc, argv + 1, argc - 1);
+    if (got_config_arguments)
+    	hgc_kill (hgc, SIGINT);
     hgc_close(hgc);
     hgc = NULL;
     return exitcode;