From da50ba30b371f21f264c040ca9f2161771d55233 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 10 Sep 2007 16:28:04 +0200 Subject: apt-pkg/deb/dpkgpm.cc: - ignore EINTR on select() --- apt-pkg/deb/dpkgpm.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 36086d72e..ac63ccfdf 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -818,12 +818,16 @@ bool pkgDPkgPM::Go(int OutStatusFd) tv.tv_sec = 1; tv.tv_usec = 0; select_ret = select(max(master, _dpkgin)+1, &rfds, NULL, NULL, &tv); - if (select_ret < 0) { - std::cerr << "Error in select()" << std::endl; - continue; - } else if (select_ret == 0) - continue; - + if (select_ret == 0) + continue; + else if (select_ret < 0 && errno == EINTR) + continue; + else if (select_ret < 0) + { + perror("select() returned error"); + continue; + } + if(master >= 0 && FD_ISSET(master, &rfds)) DoTerminalPty(master); if(master >= 0 && FD_ISSET(0, &rfds)) -- cgit v1.2.3