Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > epoch/2 bug in filelock.rb?

Reply
Thread Tools

epoch/2 bug in filelock.rb?

 
 
Josef 'Jupp' SCHUGT
Guest
Posts: n/a
 
      01-11-2004
Hi!

With epoch/2 some program of mine without any change applied to the
source that makes use of locks suddenly started to no longer remove
the locks. Replacing

FileLock::LockedFile.open(mbox, "a") {|fp|
by
File.open(mbox, "a") {|fp|

makes everything (except the locks of course) work again. Presently
using that insecure mode

Bug in filelock.rb (VERSION = 0.2) or problem with my stone-old Linux
kernel (2.0.30, yes, really ?

I am presently using ruby 1.8.0 (2003-08-04) [i586-linux].

Josef 'Jupp' SCHUGT
--
http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby-FAQ
http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Germany 2004: To boldly spy where no GESTAPO / STASI has spied before


 
Reply With Quote
 
 
 
 
Josef 'Jupp' SCHUGT
Guest
Posts: n/a
 
      01-14-2004
Hi!

Nobody provided an answer so I did look into the problem.

In _filelock.c

return rb_iv_set(self, "@locked", INT2FIX(st.st_mtime));

must be replaced by

return rb_iv_set(self, "@locked", INT2NUM(st.st_mtime));

For Ruby 1.8

require "final"

must be removed from lib/filelock.rb.

Josef 'Jupp' SCHUGT
--
http://oss.erdfunkstelle.de/ruby/ - German comp.lang.ruby-FAQ
http://rubyforge.org/users/jupp/ - Ruby projects at Rubyforge
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Germany 2004: To boldly spy where no GESTAPO / STASI has spied before


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
*bug* *bug* *bug* David Raleigh Arnold Firefox 12 04-02-2007 03:13 AM
ASP.NET Login control bug or SQL 2005 bug? RedEye ASP .Net 2 12-13-2005 10:57 AM
Re: BUG? OR NOT A BUG? John ASP .Net 2 09-21-2005 10:31 AM
Bug Parade Bug 4953793 Michel Joly de Lotbiniere Java 4 12-02-2003 05:05 AM
how to report bug to g++ ? got a bug and fixed up source code DarkSpy C++ 4 06-27-2003 09:05 AM



Advertisments