[ekg2-commit] ekg2: dcc.c (HEAD) [peres]
CVS commit
cvs w toxygen.net
Pią, 11 Maj 2007, 15:58:08 CEST
Module name: ekg2
Changes by: peres 2007-05-11 15:58:06
Modified files:
dcc.c
Log message:
Old order, but new formats, S_ISREG instead of !S_ISDIR and O_NONBLOCK
to be sure.
Index: dcc.c
===================================================================
RCS file: /home/cvs/ekg2/plugins/gg/dcc.c,v
diff -d -u -r1.42 -r1.43
--- dcc.c 10 May 2007 21:25:12 -0000 1.42
+++ dcc.c 11 May 2007 13:58:06 -0000 1.43
@@ -264,13 +264,16 @@
return -1;
}
- if (!stat(fn, &st) && S_ISDIR(st.st_mode)) {
- printq("dcc_open_error", params[2], strerror(EISDIR));
+ if (!stat(fn, &st) && !S_ISREG(st.st_mode)) {
+ printq("io_nonfile", params[2]);
return -1;
}
-
- if ((fd = open(fn, O_RDONLY)) == -1) {
- printq("dcc_open_error", params[2], strerror(errno));
+
+ if ((fd = open(fn, O_RDONLY|O_NONBLOCK)) == -1) {
+ if (errno == ENXIO)
+ printq("io_nonfile", params[2]);
+ else
+ printq("io_cantopen", params[2], strerror(errno));
return -1;
}
Więcej informacji o liście dyskusyjnej ekg2-commit