~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to src/crash.c

  • Committer: Didier Roche
  • Date: 2018-07-02 09:17:23 UTC
  • Revision ID: didier.roche@canonical.com-20180702091723-i6tqivm7394d2lbv
* Use absolute patch when testing if whoopsie service is enabled.
* Add some debug messages

Show diffs side-by-side

added added

removed removed

Lines of Context:
151
151
   // if whoopsie is installed, by disabled, don't do anything
152
152
   if (g_file_test(CRASHREPORT_WHOOPSIE_EXEC, G_FILE_TEST_IS_EXECUTABLE)) {
153
153
      int exitcode;
154
 
      gchar *argv[] = { "systemctl", "is-enabled", "-q", CRASHREPORT_WHOOPSIE_SERVICE, NULL };
 
154
      gchar *argv[] = { "/bin/systemctl", "is-enabled", "-q", CRASHREPORT_WHOOPSIE_SERVICE, NULL };
155
155
      if (g_spawn_sync(NULL, argv, NULL, G_SPAWN_STDOUT_TO_DEV_NULL|G_SPAWN_STDERR_TO_DEV_NULL,
156
156
                      NULL, NULL, NULL, NULL, &exitcode, NULL)) {
157
 
          if (exitcode != 0)
158
 
              return FALSE;
 
157
         if (exitcode != 0) {
 
158
            g_debug("whoopsie disabled, not displaying crashes");
 
159
            return FALSE;
 
160
         }
159
161
      }
160
 
 
161
162
   }
162
163
 
163
164
   // Check whether the user doesn't want notifications