[maemo-developers] [maemo-developers] Adding swapon/off to Jakub's Load-Plugin applet
From: Stefan Kost ensonic at hora-obscura.deDate: Tue Feb 28 12:11:28 EET 2006
- Previous message: [maemo-developers] Adding swapon/off to Jakub's Load-Plugin applet
- Next message: [maemo-developers] GStreamer & mpeg4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hi,
instead of
if (swapname && strncmp(swapname, "", 1) != 0) {
just write
if (swapname && *swapname) {
Stefan
Henry Tan1g wrote:
> Hi,
>
> I tried your version of the Load-Plugin applet. Unfortunately it makes
> de device reboot everytime I click on the applet. I could repeat the
> problem inside scratchbox. After going through the source, I found out
> that the problem is swapname not being initialized the first time.
> Here's a small patch to make it work.
>
> diff -Naur loadapplet-aw/load-plugin.c loadapplet-henry/load-plugin.c
> --- loadapplet-aw/load-plugin.c 2006-02-28 00:32:41.000000000 +0100
> +++ loadapplet-henry/load-plugin.c 2006-02-27 22:50: 01.000000000 +0100
> @@ -536,7 +536,7 @@
> gtk_menu_shell_append(GTK_MENU_SHELL(info->menu),
> info->menu_separator);
> /* Swap */
> - if (strncmp(swapname, "", 1) != 0) {
> + if (swapname && strncmp(swapname, "", 1) != 0) {
> if (swapisactive())
> sprintf(label, "swapoff %s (%d MB used)", swapname,
> (swapused+512)/1024);
> else
>
> Regards,
>
> Henry
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://maemo.org/mailman/listinfo/maemo-developers
- Previous message: [maemo-developers] Adding swapon/off to Jakub's Load-Plugin applet
- Next message: [maemo-developers] GStreamer & mpeg4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
