[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] A nuisance in Vend::Util.pm?
****** message to minivend-users from Sergio Polini <s.polini@mclink.it> ******
Perhaps I'm missing something, since I'm new to Minivend.
My problem was that I could not stop it; both -stop and -kill gave me the same
message about a file that could not be locked. I've found a workaround, but it
is very dirty :-)
I've installed Minivend 4.04 on my Linux (RedHat 6.2) as sp:users and always run
it as sp:users (I'm just studying for now...). My Linux is "localized" as
italian: here is the problem, as far as I can guess.
The message I was getting was:
Could not lock file: Risorsa temporaneamente non disponibile
i.e., "Resourse temporarily unavailable" in italian...
In Vend::Util.pm, subroutine flock_lock, I read:
if (! flock($fh, $flag | $flock_LOCK_NB)) {
if ($! =~ m/^Try again/
or $! =~ m/^Resource temporarily unavailable/
or $! =~ m/^Operation would block/) {
return 0;
}
else {
die "Could not lock file: $! ($errno)\n";
}
}
The error code is checked againt its english description!
I tried:
else {
my $errno = $! + 1000;
die "Could not lock file: $! ($errno)\n";
}
so I was able to patch the if branch:
if ($! =~ m/^Try again/
or $! =~ m/^Resource temporarily unavailable/
or $! == 11 # :-(
or $! =~ m/^Operation would block/) {
return 0;
}
Stop and kill work well now, but I'm not proud for my hack :-)
Any better ideas?
Tranks.
Sergio
--------------------------------------------------------------------
Sergio Polini "The box said
e-mail : s.polini@mclink.it `Requires Windows 95, NT or
PGP key: http://pgp5.ai.mit.edu better.' So I installed Linux."
--------------------------------------------------------------------
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list