~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to modules/printbackends/lpr/gtkprintbackendlpr.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-09-23 09:50:04 UTC
  • mfrom: (1.5.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: james.westby@ubuntu.com-20090923095004-e9xauadn4bjs5n7m
Tags: upstream-2.18.0
ImportĀ upstreamĀ versionĀ 2.18.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
    {
279
279
      gsize bytes_written;
280
280
 
281
 
      g_io_channel_write_chars (ps->in, 
 
281
      signal (SIGPIPE, SIG_IGN);
 
282
 
 
283
      g_io_channel_write_chars (ps->in,
282
284
                                buf, 
283
285
                                bytes_read, 
284
286
                                &bytes_written, 
320
322
                                    GDestroyNotify          dnotify)
321
323
{
322
324
  GError *print_error = NULL;
323
 
  GtkPrinter *printer;
324
325
  _PrintStreamData *ps;
325
326
  GtkPrintSettings *settings;
326
 
  gint argc;  
 
327
  gint argc;
327
328
  gint in_fd;
328
329
  gchar **argv = NULL;
329
330
  const char *cmd_line;
330
 
  
331
 
  printer = gtk_print_job_get_printer (job);
 
331
 
332
332
  settings = gtk_print_job_get_settings (job);
333
333
 
334
334
  cmd_line = gtk_print_settings_get (settings, "lpr-commandline");
335
335
  if (cmd_line == NULL)
336
336
    cmd_line = LPR_COMMAND;
337
 
  
 
337
 
338
338
  ps = g_new0 (_PrintStreamData, 1);
339
339
  ps->callback = callback;
340
340
  ps->user_data = user_data;
344
344
 
345
345
 /* spawn lpr with pipes and pipe ps file to lpr */
346
346
  if (!g_shell_parse_argv (cmd_line, &argc, &argv, &print_error))
347
 
    goto out; 
 
347
    goto out;
348
348
 
349
349
  if (!g_spawn_async_with_pipes (NULL,
350
350
                                 argv,
366
366
    {
367
367
      if (ps->in != NULL)
368
368
        g_io_channel_unref (ps->in);
369
 
      
 
369
 
370
370
      goto out;
371
371
    }
372
372
 
373
373
  g_io_channel_set_close_on_unref (ps->in, TRUE);
374
374
 
375
 
  g_io_add_watch (data_io, 
 
375
  g_io_add_watch (data_io,
376
376
                  G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP,
377
377
                  (GIOFunc) lpr_write,
378
378
                  ps);