Re: frequently updated pixbuf images disapear after a while
- From: "Peter \"Firefly\" Lund" <firefly diku dk>
- To: rupert <rupertt gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: frequently updated pixbuf images disapear after a while
- Date: Sun, 27 Aug 2006 12:43:24 +0200 (CEST)
On Sun, 27 Aug 2006, rupert wrote:
gboolean crypto_mapper_check(gchar *data)
{
gchar *mapper_chk_cmd;
gboolean result_mapper=FALSE;
mapper_chk_cmd = g_strdup_printf("/dev/mapper/%s", data);
FILE *fp = fopen(mapper_chk_cmd, "r");
g_free(mapper_chk_cmd);
if(fp)
result_mapper = TRUE;
else
result_mapper = FALSE;
if (fp)
fclose(fp)
//fclose(fp); /* this one crashes the the app when enabled*/
return result_mapper;
}
alternatives (not compile tested):
gboolean crypt_mapper_check(gchar *data)
{
gchar *s;
FILE *fp;
s = g_strdup_printf("/dev/mapper/%s", data);
fp = fopen(s, "r");
g_free(s);
if (fp) {
fclose(fp);
return TRUE;
} else
return FALSE;
}
gboolean crypt_mapper_check(gchar *data)
{
gchar *s;
FILE *fp;
s = g_strdup_printf("/dev/mapper/%s", data);
fp = fopen(s, "r");
g_free(s);
if (fp)
fclose(fp);
return fp != NULL;
}
-Peter
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]