On Sat, 1 Feb 2003, Melvin Hadasht wrote:
I got one problem: the bm_srv12 displayed the following when it was attempted to open the bookmark page: bm_srv12: accepting connections... [accept]: Invalid argument
checking why, I found the bug was that the accept() function was called with an uninitialized *addrlen (third) argument. According to the man page on GNU/Linux, "The addrlen argument is a value-result parameter: it should initially contain the size of the structure pointed to by addr; on return it will contain the actual length (in bytes) of the address returned. When addr is NULL nothing is filled in."
So I made the following patch: --- bm_srv12.c Fri Jan 31 17:22:36 2003 +++ bm_srv12_modified.c Sat Feb 1 22:00:23 2003 @@ -1694,7 +1694,7 @@ int main (void) { struct sockaddr_un pun; int sock_descriptor; int temp_sock_descriptor; - int address_size; + int address_size = sizeof(struct sockaddr_un); char buf[16384]; int st, code;
Looked bm_srv code now and discovered variable named "sun" before pun in main function. Which is not a good variable name, when you want to compile it on solaris (solaris c library headers contain something like #define sun 1).