Re: [patch] fishfs bugs

2003-02-16 Thread Arpi
Hi,

  the first chunk is trivial: you check for got_interrupt but it is always a
  non-zero number, actually the address of teh got_interrupt() function :))
  you probably noticed that it doesn't work so that ! was removed :)
  
  the second part is probably bug, i see no sense of checking for
  got_interrupt() if interrupt check is disabled...
 
 First part is okay, but I have doubts about second

what?

 one. disable_interrupt_key() has something to do ^c, IIRC.

exactly.
disable_interrupt_key disables the SIGINT (ctrl^c) handler,
enable_interrupt_key enables it.
got_interrupt() returns 1 if ctrl^c was pressed since last call.
(the SIGINT handler (enabled by enable_interrupt_key) sets a flag
when user press ctrl^c, and this flag is query-able with got_interrupt)
it only works if ctrl^c is enabled at all (enable_interrupt_key),
so calling it after disable_interrupt_key has no sense.
RTFS...


A'rpi / Astral  ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
However, many people beg for its inclusion in Debian. Why? - Gabucino
  Because having new software in Debian is good. - Josselin Mouette
Because having good software in Debian is new. - Gabucino
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



[patch] fishfs bugs

2003-02-13 Thread Arpi
Hi,

the first chunk is trivial: you check for got_interrupt but it is always a
non-zero number, actually the address of teh got_interrupt() function :))
you probably noticed that it doesn't work so that ! was removed :)

the second part is probably bug, i see no sense of checking for
got_interrupt() if interrupt check is disabled...


Index: fish.c
===
RCS file: /cvsroot/arpi/amc-4.6/vfs/fish.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 fish.c
--- fish.c  10 Feb 2003 23:16:45 -  1.1.1.1
+++ fish.c  13 Feb 2003 20:12:47 -
@@ -527,7 +527,7 @@
 
 while (1) {
while ((n = read(h, buffer, sizeof(buffer)))  0) {
-   if ((errno == EINTR)  got_interrupt)
+   if ((errno == EINTR)  !got_interrupt())
continue;
print_vfs_message(_(fish: Local read failed, sending zeros) );
close(h);
@@ -615,13 +615,13 @@
 vfs_s_super *super = FH_SUPER;
 int n = 0;
 len = MIN( fh-u.fish.total - fh-u.fish.got, len );
-disable_interrupt_key();
+enable_interrupt_key();
 while (len  ((n = read (SUP.sockr, buf, len))0)) {
 if ((errno == EINTR)  !got_interrupt())
continue;
break;
 }
-enable_interrupt_key();
+disable_interrupt_key();
 
 if (n0) fh-u.fish.got += n;
 if (n0) linear_abort(me, fh);



A'rpi / Astral  ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
However, many people beg for its inclusion in Debian. Why? - Gabucino
  Because having new software in Debian is good. - Josselin Mouette
Because having good software in Debian is new. - Gabucino
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel