Quellcode durchsuchen

libdpkg: Add new SUBPROC_RETSIGNO to return the signal number

This will allow to replace some ad-hoc code in debsig-verify.
Guillem Jover vor 11 Jahren
Ursprung
Commit
6821616fc6
2 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 2 0
      lib/dpkg/subproc.c
  2. 2 0
      lib/dpkg/subproc.h

+ 2 - 0
lib/dpkg/subproc.c

@@ -143,6 +143,8 @@ subproc_check(int status, const char *desc, enum subproc_flags flags)
 			return 0;
 		if ((flags & SUBPROC_NOPIPE) && n == SIGPIPE)
 			return 0;
+		if (flags & SUBPROC_RETSIGNO)
+			return n;
 
 		if (n == SIGINT)
 			out(_("subprocess %s was interrupted"), desc);

+ 2 - 0
lib/dpkg/subproc.h

@@ -44,6 +44,8 @@ enum subproc_flags {
 	SUBPROC_NOCHECK		= DPKG_BIT(2),
 	/** Do not emit errors, just return the exit status. */
 	SUBPROC_RETERROR	= DPKG_BIT(3),
+	/** Do not emit errors, just return the signal number. */
+	SUBPROC_RETSIGNO	= DPKG_BIT(3),
 };
 
 void subproc_signals_ignore(const char *name);