Alright, as some of you know, I downloaded Cygwin to compile Unix code under windows.
I have a MUD(Multi User Demension/Dungeon) that I am writing. I have a nice shell that allows player connection, and character creation. It compiled 100% fine under the Linux server I WAS using. Now I downloaded Cygwin, and I have a slight problem.
It compiles fine, with no errors. However, when I run the program it logs an error in the log files, and then shuts down.
Heres the error I got:
*Wed May 29 15:04:50 2002: mux select(): Bad file number*
And Heres the Code that uses that:
Code:
...
int max_files;
...
if ((max_files = getdtablesize()) == -1) {
log_to_file(LOG_ERRNO, "getdtablesize()");
exit(EXIT_FAILURE);
}
is_running = TRUE;
while (is_running) {
FD_ZERO(&input_sfd);
FD_ZERO(&output_sfd);
FD_ZERO(&exception_sfd);
FD_SET(control, &input_sfd);
for (con = first_con; con != NULL; con = con->next) {
FD_SET(con->sd, &input_sfd);
FD_SET(con->sd, &output_sfd);
FD_SET(con->sd, &exception_sfd);
}
if (select(max_files, &input_sfd, &output_sfd, &exception_sfd, &tv_zero) == -1) {
log_to_file(LOG_ERRNO, "mux select()");
exit(EXIT_FAILURE);
}
...
Some of that may be irrelevent... but you can see the 'mux select()' part. I figured bad file number means that it can't log the error number? I'm not sure. And I've no clue why it would be messing up. I'm not a genius at sockets, and I followed a unix tutorial and fumbled my way through creating the basic MUD engine, but it works fine. Well, it used to. Nothing has changed sense I compiled on the server. does anyone have a clue to why it is not working? Or point me in a general direction?
Thanks!