summaryrefslogtreecommitdiffstats
path: root/draksnapshot-applet
diff options
context:
space:
mode:
authortv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2008-03-17 16:36:02 +0000
committertv <tv@99302b65-d5f7-0310-b3dd-f8cd6f4e3d94>2008-03-17 16:36:02 +0000
commit9e0639740772e511d1473b4be927c4792c82661e (patch)
treedbe0bcdeb963658746d03406c142f48744fffadc /draksnapshot-applet
parent89cdf896d312536688d855529ebd48a1b3bda8c7 (diff)
downloaddraksnapshot-9e0639740772e511d1473b4be927c4792c82661e.tar
draksnapshot-9e0639740772e511d1473b4be927c4792c82661e.tar.gz
draksnapshot-9e0639740772e511d1473b4be927c4792c82661e.tar.bz2
draksnapshot-9e0639740772e511d1473b4be927c4792c82661e.tar.xz
draksnapshot-9e0639740772e511d1473b4be927c4792c82661e.zip
typo fix (Reinout van Schouwen)
git-svn-id: http://svn.mandriva.com/svn/soft/draksnapshot/trunk@239841 99302b65-d5f7-0310-b3dd-f8cd6f4e3d94
Diffstat (limited to 'draksnapshot-applet')
-rwxr-xr-xdraksnapshot-applet43
1 files changed, 38 insertions, 5 deletions
diff --git a/draksnapshot-applet b/draksnapshot-applet
index ce95772..7ffe75e 100755
--- a/draksnapshot-applet
+++ b/draksnapshot-applet
@@ -56,7 +56,7 @@ my %state = (
},
disk_found => {
menu => [ 'configure' ],
- tt => [ N_("USB discs are availlable for backups") ]
+ tt => [ N_("USB discs are available for backups") ]
},
config_in_progress => {
menu => [],
@@ -96,7 +96,22 @@ Gtk2->main;
ugtk2::exit(0);
-my $config_pid;
+my ($config_pid, $checker_pid);
+
+
+my %comm_codes = (
+ discs => {
+ code => 2,
+ status => 'locked',
+ log => N_("urpmi database locked") . ", skipping updating urpmi database",
+ },
+ nothing => {
+ code => 3,
+ status => 'critical',
+ log => N_("Error updating media"),
+ },
+);
+
# Signal management
sub harvester {
@@ -111,6 +126,14 @@ sub harvester {
# we should better check it has really been configured indeed.
setAutoStart('FALSE');
ugtk2::exit(0);
+ } elsif ($checker_pid && $checker_pid == $childpid) {
+ undef $checker_pid;
+ my $status = $? >> 8;
+ my ($state) = grep { $_->{code} eq $status } values %comm_codes;
+ if ($state) {
+ logIt($state->{log});
+ go2State($state->{status});
+ }
}
push @pids, $childpid;
WIFEXITED($?) and refresh_gui(1);
@@ -145,9 +168,19 @@ sub silentCheck() {
my $w = $::main_window ? $::main_window->window : undef;
gtkset_mousecursor_wait($w);
- # force refreshing cache:
- detect_devices::probeall_update_cache();
- @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI();
+ $checker_pid = fork();
+ if (defined $checker_pid) {
+ return if $checker_pid; # parent
+
+ # immediate exit, else forked gtk+ object destructors will badly catch up parent applet
+ my $_safe = before_leaving { POSIX::_exit(0) };
+
+ # force refreshing cache:
+
+ detect_devices::probeall_update_cache();
+ @discs = grep { $_->{usb_bus} && detect_devices::may_be_a_hd($_) } detect_devices::getSCSI();
+ }
+
go2State('okay') if !@discs;
# are there any updates ?