nbd umira

Pavel Kankovsky peak na argo.troja.mff.cuni.cz
Sobota Listopad 26 23:37:51 CET 2005


On Wed, 23 Nov 2005, Dalibor Straka wrote:

> --- nbd-server.c             2005-11-23 11:46:26.724325105 +0100
> +++ /tmp/nbd-server.orig.c   2005-11-23 11:45:25.834480286 +0100
> @@ -366,14 +366,10 @@
>          int* status=NULL;
>         int* i;
>         pid_t pid;
> -       int bye=1;
>  
> -       msg2(LOG_INFO, "In the Sig chld handler");
> -       while(bye && (pid=wait(status)) > 0) {
> +       while((pid=wait(status)) > 0) {
>                 if(WIFEXITED(status)) {
>                         msg3(LOG_INFO, "Child exited with %d", WEXITSTATUS(status));
> -                       msg3(LOG_INFO, "Pid=wait(status) is %d", pid);
> -                       bye=0;
>                 }
>                 i=g_hash_table_lookup(children, &pid);
>                 if(!i) {
> @@ -383,7 +379,6 @@
>                         g_hash_table_remove(children, &pid);
>                 }
>         }
> -       msg2(LOG_INFO, "Out of the Sig chld handler");
>  }

Tohle je handler na SIGCHLD? Proboha ziveho, kdo to naprogramoval?!

(Jsou msg2() a msg3() reentrantni? Jsou g_hash_table_lookup() a 
g_hash_table_remove() reentrantni...tedy presneji "koentrantni"
s jinymi operacemi nad tou samou hasovaci tabulkou?)

--Pavel Kankovsky aka Peak  [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."



Další informace o konferenci Linux