SIGUSR1 does now a full restat of tint2

git-svn-id: http://tint2.googlecode.com/svn/trunk@424 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
thilor77
2010-04-18 14:28:45 +00:00
parent c298a39d00
commit 7ee42e8ca1
17 changed files with 108 additions and 136 deletions

View File

@@ -94,6 +94,7 @@ void default_battery()
void cleanup_battery()
{
printf("*** cleanup_battery()\n");
if (bat1_font_desc) pango_font_description_free(bat1_font_desc);
if (bat2_font_desc) pango_font_description_free(bat2_font_desc);
if (path_energy_now) g_free(path_energy_now);
@@ -133,7 +134,6 @@ void init_battery()
if (directory)
g_dir_close(directory);
if (!battery_dir) {
cleanup_battery();
fprintf(stderr, "ERROR: battery applet can't found power_supply\n");
return;
}
@@ -166,6 +166,7 @@ void init_battery()
fp4 = fopen(path_status, "r");
if (fp1 == NULL || fp2 == NULL || fp3 == NULL || fp4 == NULL) {
cleanup_battery();
default_battery();
fprintf(stderr, "ERROR: battery applet can't open energy_now\n");
}
fclose(fp1);