* Copyright (c) 2002 Cray Inc.
* Copyright (c) 2002 Eric Hoffman
*
- * This file is part of Portals, http://www.sf.net/projects/sandiaportals/
+ * This file is part of Lustre, http://www.lustre.org.
*
- * Portals is free software; you can redistribute it and/or
- * modify it under the terms of version 2.1 of the GNU Lesser General
- * Public License as published by the Free Software Foundation.
+ * Lustre is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
*
- * Portals is distributed in the hope that it will be useful,
+ * Lustre is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with Portals; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with Lustre; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
static void set_flag(io_handler n,fd_set *fds)
{
- if (n->type & READ_HANDLER) FD_SET(n->fd,fds);
- if (n->type & WRITE_HANDLER) FD_SET(n->fd,fds+1);
- if (n->type & EXCEPTION_HANDLER) FD_SET(n->fd,fds+2);
+ if (n->type & READ_HANDLER) FD_SET(n->fd, &fds[0]);
+ if (n->type & WRITE_HANDLER) FD_SET(n->fd,&fds[1]);
+ if (n->type & EXCEPTION_HANDLER) FD_SET(n->fd, &fds[2]);
}
timeout_pointer=&timeout;
} else timeout_pointer=0;
- FD_ZERO(fds);
- FD_ZERO(fds+1);
- FD_ZERO(fds+2);
+ FD_ZERO(&fds[0]);
+ FD_ZERO(&fds[1]);
+ FD_ZERO(&fds[2]);
for (k=&io_handlers;*k;){
if ((*k)->disabled){
j=*k;
k=&(*k)->next;
}
}
- result=select(FD_SETSIZE,fds,fds+1,fds+2,timeout_pointer);
+
+ result=select(FD_SETSIZE, &fds[0], &fds[1], &fds[2], timeout_pointer);
if (result > 0)
for (j=io_handlers;j;j=j->next){
if (!(j->disabled) &&
- ((FD_ISSET(j->fd,fds) && (j->type & READ_HANDLER)) ||
- (FD_ISSET(j->fd,fds+1) && (j->type & WRITE_HANDLER)) ||
- (FD_ISSET(j->fd,fds+2) && (j->type & EXCEPTION_HANDLER)))){
+ ((FD_ISSET(j->fd, &fds[0]) && (j->type & READ_HANDLER)) ||
+ (FD_ISSET(j->fd, &fds[1]) && (j->type & WRITE_HANDLER)) ||
+ (FD_ISSET(j->fd, &fds[2]) && (j->type & EXCEPTION_HANDLER)))){
if (!(*j->function)(j->argument))
j->disabled=1;
}