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

« back to all changes in this revision

Viewing changes to src/crash.c

  • Committer: Michael Vogt
  • Date: 2011-01-03 15:28:00 UTC
  • Revision ID: michael.vogt@ubuntu.com-20110103152800-1z3pzbjr7wcny3n2
* src/crash.c:
  - use g_spawn_sync() instead of g_spawn_sync_command_line and
    pass G_SPAWN_STDOUT_TO_DEV_NULL|G_SPAWN_STDERR_TO_DEV_NULL

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
      return FALSE;
24
24
 
25
25
   // check for system crashes
26
 
   if(!g_spawn_command_line_sync(CRASHREPORT_HELPER " --system", &stdlog, NULL, 
27
 
                                 &exitcode, NULL)) {
 
26
   gchar *argv[] = { CRASHREPORT_HELPER, "--system", NULL };
 
27
   if(!g_spawn_sync(NULL,
 
28
                    argv,
 
29
                    NULL,
 
30
                    G_SPAWN_STDOUT_TO_DEV_NULL|G_SPAWN_STDERR_TO_DEV_NULL,
 
31
                    NULL,
 
32
                    NULL,
 
33
                    NULL,
 
34
                    NULL,
 
35
                    &exitcode,
 
36
                    NULL)) {
28
37
      g_warning("Can not run %s\n", CRASHREPORT_HELPER);
29
38
      return FALSE;
30
39
   }
99
108
   int crashreports_found = 0;
100
109
   static gboolean first_run = TRUE;
101
110
   gboolean system_crashes;
102
 
   gchar *stdlog;
103
 
   //   g_debug("crashreport_check\n");
104
 
 
 
111
   g_debug("crashreport_check\n");
 
112
   
105
113
   // don't do anything if no apport-gtk is installed
106
114
   if(!g_file_test(CRASHREPORT_REPORT_APP, G_FILE_TEST_IS_EXECUTABLE))
107
115
      return FALSE;
116
124
   // check for (new) reports by calling CRASHREPORT_HELPER
117
125
   // and checking the return code
118
126
   int exitcode;
119
 
   if(!g_spawn_command_line_sync(CRASHREPORT_HELPER, &stdlog, NULL,
120
 
                                 &exitcode, NULL)) {
 
127
   gchar *argv[] = { CRASHREPORT_HELPER, NULL };
 
128
   if(!g_spawn_sync(NULL,
 
129
                    argv,
 
130
                    NULL,
 
131
                    G_SPAWN_STDOUT_TO_DEV_NULL|G_SPAWN_STDERR_TO_DEV_NULL,
 
132
                    NULL,
 
133
                    NULL,
 
134
                    NULL,
 
135
                    NULL,
 
136
                    &exitcode,
 
137
                    NULL)) {
121
138
      g_warning("Can not run %s\n", CRASHREPORT_HELPER);
122
139
      return FALSE;
123
140
   }