From f4a7751dc7a17a4b423bc0177b4776989d6c69a9 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 12 Aug 1999 20:46:29 +0000 Subject: [PATCH] bail out if select returns errors besides EINTR --- src/libCom/fdManager.cc | 78 ++++++++++++++++------------------ src/libCom/fdmgr/fdManager.cpp | 78 ++++++++++++++++------------------ 2 files changed, 74 insertions(+), 82 deletions(-) diff --git a/src/libCom/fdManager.cc b/src/libCom/fdManager.cc index 8dc9175fe..b83bf5a2b 100644 --- a/src/libCom/fdManager.cc +++ b/src/libCom/fdManager.cc @@ -1,39 +1,37 @@ -/* - * $Id$ - * - * File descriptor management C++ class library - * (for multiplexing IO in a single threaded environment) - * - * Author Jeffrey O. Hill - * johill@lanl.gov - * 505 665 1831 - * - * Experimental Physics and Industrial Control System (EPICS) - * - * Copyright 1991, the Regents of the University of California, - * and the University of Chicago Board of Governors. - * - * This software was produced under U.S. Government contracts: - * (W-7405-ENG-36) at the Los Alamos National Laboratory, - * and (W-31-109-ENG-38) at Argonne National Laboratory. - * - * Initial development by: - * The Controls and Automation Group (AT-8) - * Ground Test Accelerator - * Accelerator Technology Division - * Los Alamos National Laboratory - * - * Co-developed with - * The Controls and Computing Group - * Accelerator Systems Division - * Advanced Photon Source - * Argonne National Laboratory - * - * - * - */ - +// +// $Id$ +// +// File descriptor management C++ class library +// (for multiplexing IO in a single threaded environment) +// +// Author Jeffrey O. Hill +// johill@lanl.gov +// 505 665 1831 +// +// Experimental Physics and Industrial Control System (EPICS) +// +// Copyright 1991, the Regents of the University of California, +// and the University of Chicago Board of Governors. +// +// This software was produced under U.S. Government contracts: +// (W-7405-ENG-36) at the Los Alamos National Laboratory, +// and (W-31-109-ENG-38) at Argonne National Laboratory. +// +// Initial development by: +// The Controls and Automation Group (AT-8) +// Ground Test Accelerator +// Accelerator Technology Division +// Los Alamos National Laboratory +// +// Co-developed with +// The Controls and Computing Group +// Accelerator Systems Division +// Advanced Photon Source +// Argonne National Laboratory +// +// +// // // // NOTES: @@ -193,16 +191,14 @@ epicsShareFunc void fdManager::process (double delay) return; } else if (status<0) { - if (SOCKERRNO == SOCK_EINTR) { - this->processInProg = 0; - return; - } - else { + if (SOCKERRNO != SOCK_EINTR) { fprintf(stderr, "fdManager: select failed because errno=%d=\"%s\"\n", SOCKERRNO, SOCKERRSTR); } - } + this->processInProg = 0; + return; + } // // Look for activity diff --git a/src/libCom/fdmgr/fdManager.cpp b/src/libCom/fdmgr/fdManager.cpp index 8dc9175fe..b83bf5a2b 100644 --- a/src/libCom/fdmgr/fdManager.cpp +++ b/src/libCom/fdmgr/fdManager.cpp @@ -1,39 +1,37 @@ -/* - * $Id$ - * - * File descriptor management C++ class library - * (for multiplexing IO in a single threaded environment) - * - * Author Jeffrey O. Hill - * johill@lanl.gov - * 505 665 1831 - * - * Experimental Physics and Industrial Control System (EPICS) - * - * Copyright 1991, the Regents of the University of California, - * and the University of Chicago Board of Governors. - * - * This software was produced under U.S. Government contracts: - * (W-7405-ENG-36) at the Los Alamos National Laboratory, - * and (W-31-109-ENG-38) at Argonne National Laboratory. - * - * Initial development by: - * The Controls and Automation Group (AT-8) - * Ground Test Accelerator - * Accelerator Technology Division - * Los Alamos National Laboratory - * - * Co-developed with - * The Controls and Computing Group - * Accelerator Systems Division - * Advanced Photon Source - * Argonne National Laboratory - * - * - * - */ - +// +// $Id$ +// +// File descriptor management C++ class library +// (for multiplexing IO in a single threaded environment) +// +// Author Jeffrey O. Hill +// johill@lanl.gov +// 505 665 1831 +// +// Experimental Physics and Industrial Control System (EPICS) +// +// Copyright 1991, the Regents of the University of California, +// and the University of Chicago Board of Governors. +// +// This software was produced under U.S. Government contracts: +// (W-7405-ENG-36) at the Los Alamos National Laboratory, +// and (W-31-109-ENG-38) at Argonne National Laboratory. +// +// Initial development by: +// The Controls and Automation Group (AT-8) +// Ground Test Accelerator +// Accelerator Technology Division +// Los Alamos National Laboratory +// +// Co-developed with +// The Controls and Computing Group +// Accelerator Systems Division +// Advanced Photon Source +// Argonne National Laboratory +// +// +// // // // NOTES: @@ -193,16 +191,14 @@ epicsShareFunc void fdManager::process (double delay) return; } else if (status<0) { - if (SOCKERRNO == SOCK_EINTR) { - this->processInProg = 0; - return; - } - else { + if (SOCKERRNO != SOCK_EINTR) { fprintf(stderr, "fdManager: select failed because errno=%d=\"%s\"\n", SOCKERRNO, SOCKERRSTR); } - } + this->processInProg = 0; + return; + } // // Look for activity