On Fri, Feb 22, 2002 at 10:59:12AM +0000, Brian Candler wrote:
> 'make check' fails when building courier-0.37.2.20020220 under FreeBSD-4.4.
> It seems to be something to do with handling of the \Recent flag - the
> relevant output and a comparison of the actual and expected testsuite
> results are attached below.
>
> Maybe related are some 'fcntl' errors which are appearing too.
I have nailed this down, and it turns out to be trivial. The problem is that
setting O_NONBLOCK on fd 1 in imapd.c fails (see below). If you ignore the
failure, it generates the correct regression test output.
A little further testing shows that you can't set O_NONBLOCK on /dev/null,
which is what the testsuite pipes stdout to.
$ cat >mytest.c <<EOF
#include <stdio.h>
#include <fcntl.h>
int main(void)
{
fprintf(stderr,"%d\n",fcntl(0, F_SETFL, O_NONBLOCK));
fprintf(stderr,"%d\n",fcntl(1, F_SETFL, O_NONBLOCK));
return 0;
}
EOF
$ gcc -Wall -o mytest mytest.c
$ ./mytest
0
0
$ ./mytest >/dev/null
0
-1
So, my suggested patch to fix to this problem is simply:
--- imap/testsuite.orig Mon Feb 25 11:59:58 2002
+++ imap/testsuite Mon Feb 25 12:00:39 2002
@@ -114,7 +114,7 @@
initinbox="inbox.$initinbox"
fi
-env MAILDIR=$initdir ./imapd >/dev/null <<EOF
+env MAILDIR=$initdir ./imapd >confmdtest/stdout <<EOF
a001 select $initinbox
a logout
EOF
With this change, FreeBSD-4.4 is happy again.
Regards,
Brian.
---------------- modification to imapd.c for testing ----------------------
/* We use select() with a timeout, so use non-blocking filedescs */
if (fcntl(0, F_SETFL, O_NONBLOCK))
{
perror(__FILE__ ": fcntl(0, SETFL, O_NONBLOCK)");
/* exit(1); */
}
if (fcntl(1, F_SETFL, O_NONBLOCK))
{
perror(__FILE__ ": fcntl(0, SETFL, O_NONBLOCK)");
/* exit(1); */
}
------------------- results -----------------------
****************************
* Sanity check in progress *
****************************
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=156, body=2398
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=218, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=148, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
imapd.c: fcntl(1, SETFL, O_NONBLOCK): Operation not supported by device
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
INFO: LOGIN, user=user, ip=[127.0.0.1]
INFO: LOGOUT, user=user, ip=[127.0.0.1], headers=0, body=0
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users