소스 검색

libdpkg: Add new SUBPROC_RETSIGNO to return the signal number

This will allow to replace some ad-hoc code in debsig-verify.
Guillem Jover 11 년 전
부모
커밋
6821616fc6
2개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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);