atd-over-fso: also support for fsotdld API (incompatible to frameworkd otimed)
authorŁukasz Pankowski <lukpank@o2.pl>
Tue, 20 Apr 2010 20:05:18 +0000 (22:05 +0200)
committerMartin Jansa <Martin.Jansa@gmail.com>
Wed, 21 Apr 2010 09:08:25 +0000 (11:08 +0200)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
recipes/ffalarms/atd-over-fso/run-over-fso.patch
recipes/ffalarms/atd-over-fso_0.70.bb

index 425aca4..be79ea0 100644 (file)
@@ -1,5 +1,5 @@
 --- src/atd.c-orig     2004-02-02 16:30:39.000000000 +0100
-+++ src/atd.c  2009-09-15 22:57:35.000000000 +0200
++++ src/atd.c  2010-04-20 19:23:10.000000000 +0200
 @@ -7,10 +7,12 @@
   *    Copyright (C) 1996, Paul Gortmaker
   *    Copyright (C) 2001, Russell Nelson
  }
  
  
-@@ -345,11 +242,223 @@
+@@ -345,11 +242,232 @@
  }
  
  
 +
 +void atd_alarm_waitfor(AtdAlarm *self, time_t t)
 +{
-+GError *error;
++GError *error1, *error2;
 +
 +      if (!t)
 +              return;
 +
 +      rtc_set_time();
-+      error = NULL;
++      error1 = error2 = NULL;
 +      if (self->alarm_proxy == NULL) {
-+              g_printerr(OTIMED " not running, could not call SetAlarm\n");
-+      } else if (!dbus_g_proxy_call(self->alarm_proxy, "SetAlarm", &error,
-+                                    G_TYPE_STRING, DBUS_NAME,
-+                                    G_TYPE_INT, t, G_TYPE_INVALID,
-+                                    G_TYPE_INVALID)) {
-+              display_free_g_error(&error);
++              g_printerr(OTIMED " not running, could not call"
++                         " AddAlarm or SetAlarm\n");
++      } else if (dbus_g_proxy_call(self->alarm_proxy, "AddAlarm", &error1,
++                                   G_TYPE_STRING, DBUS_NAME,
++                                   G_TYPE_INT, t, G_TYPE_INVALID,
++                                   G_TYPE_INVALID) ||
++                 dbus_g_proxy_call(self->alarm_proxy, "SetAlarm", &error2,
++                                   G_TYPE_STRING, DBUS_NAME,
++                                   G_TYPE_INT, t, G_TYPE_INVALID,
++                                   G_TYPE_INVALID)) {
++              if (error1 != NULL)
++                      g_error_free(error1);
++      } else {
++              display_free_g_error(&error1);
++              display_free_g_error(&error2);
 +      }
 +#ifdef DEBUG
 +      printf("DBus waitfor: %d\n", (int) t);
  
        argv0 = strrchr(argv[0], '/');
        if (!argv0)
-@@ -362,17 +471,36 @@
+@@ -362,17 +480,36 @@
                die("cannot chdir");
        if (!strcmp (argv0, "atq"))
                exit_atq();
                /* run all the jobs in the past */
                now = time (NULL);
                scan_from_top ();
-@@ -402,8 +530,7 @@
+@@ -402,8 +539,7 @@
  #endif
                if (next == ULONG_MAX)
                        next = 0;
index b92169e..940eefc 100644 (file)
@@ -13,7 +13,7 @@ RPROVIDES_${PN}-dev = "atd-dev"
 DEPENDS = "dbus-glib pkgconfig"
 RDEPENDS += "dbus dbus-glib frameworkd"
 
-PR = "r3"
+PR = "r4"
 
 SRC_URI = "${HANDHELDS_CVS};module=apps/atd;tag=ATD-0_70 \
                        file://atd-startup.patch;patch=1;pnum=0 \