* userv - client.c
* client code
*
- * Copyright (C)1996-1997,1999 Ian Jackson
+ * Copyright (C)1996-1997,1999-2001,2003 Ian Jackson
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
}
-static void cat_close_unwanted_pipes(void) {
+static void close_unwanted_pipes(void) {
int fd;
for (fd=0; fd<fdsetupsize; fd++) {
reading= fdsetup[fd].mods & fdm_read;
catdup(catnamebuf, fdsetup[fd].copyfd, reading ? 0 : 1);
catdup(catnamebuf, fdsetup[fd].pipefd, reading ? 1 : 0);
- cat_close_unwanted_pipes();
+ close_unwanted_pipes();
execl("/bin/cat",catnamebuf,(char*)0);
fprintf(stderr,"userv: %s: cannot exec `cat': %s\n",catnamebuf,strerror(errno));
exit(-1);
}
- if (fdsetup[fd].copyfd>2)
- if (close(fdsetup[fd].copyfd)) fsyscallerror("close real fd for %d",fd);
- if (close(fdsetup[fd].pipefd)) fsyscallerror("close pipe fd for %d",fd);
}
+ close_unwanted_pipes();
}
static void server_sendconfirm(void) {