[Noffle-users] Re: 441 error messages
Brought to you by:
bears
From: Andreas H. <and...@gm...> - 2003-05-19 15:54:06
|
following - up to myself: it seems that (with linux kernel 2.5) readdir doesn't returns '.' or '..' as first directory entries. the following patch should reanable posting with 2.5. It compiles, but due to a error in the automake script i cannot test it. Another solution would be a own readdir function, which would return the standard readdir output, but would "overread" '.' and '..'. --- outgoing.c 2003-05-19 17:50:55.000000000 +0200 +++ outgoing-2.c 2003-05-19 17:50:31.000000000 +0200 @@ -91,8 +91,9 @@ return FALSE; } Utl_cpyStr( outgoing.serv, serv ); - Out_next( NULL, NULL ); /* "." */ - Out_next( NULL, NULL ); /* ".." */ + /* the order of '.' and '..' isn't fixed in linux 2.5 */ +// Out_next( NULL, NULL ); /* "." */ +// Out_next( NULL, NULL ); /* ".." */ return Out_next( msgId, artTxt ); } @@ -104,12 +105,14 @@ Str file, line; ASSERT( outgoing.dir ); - if ( ! ( d = readdir( outgoing.dir ) ) ) - { - closedir( outgoing.dir ); - outgoing.dir = NULL; - return FALSE; - } + do { + if ( ! ( d = readdir( outgoing.dir ) ) ) + { + closedir( outgoing.dir ); + outgoing.dir = NULL; + return FALSE; + } + } while ( strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0); if ( msgId != NULL ) Utl_cpyStr( msgId, d->d_name ); HTH, andreas |