Explorar o código

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 %!s(int64=15) %!d(string=hai) anos
pai
achega
ef339f3715
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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)
 		if ((flags & PROCPIPE) && n == SIGPIPE)
 			return 0;
 			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 {
 	} else {
 		out(_("subprocess %s failed with wait status code %d"), desc,
 		out(_("subprocess %s failed with wait status code %d"), desc,
 		    status);
 		    status);