Просмотр исходного кода

libdpkg: Improve subprocess signal handling in subproc_check()

Explicitly handle user interruption, which should be slightly more
helpful for the user and will allow to use subproc_check() in dselect's
falliblesubprocess(). Improve too the output strings.
Guillem Jover лет назад: 15
Родитель
Сommit
ef339f3715
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      lib/dpkg/subproc.c

+ 6 - 2
lib/dpkg/subproc.c

@@ -123,8 +123,12 @@ subproc_check(int status, const char *desc, int flags)
 		if ((flags & PROCPIPE) && n == SIGPIPE)
 			return 0;
 
-		out(_("subprocess %s killed by signal (%s)%s"), desc,
-		    strsignal(n), WCOREDUMP(status) ? _(", core dumped") : "");
+		if (n == SIGINT)
+			out(_("subprocess %s was interrupted"), desc);
+		else
+			out(_("subprocess %s was killed by signal (%s)%s"),
+			    desc, strsignal(n),
+			    WCOREDUMP(status) ? _(", core dumped") : "");
 	} else {
 		out(_("subprocess %s failed with wait status code %d"), desc,
 		    status);