~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to sm/server.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-03-08 22:46:47 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090308224647-gq17gatcl71lrc2k
Tags: 2.0.11-1
* New upstream release. (Closes: #496663)
* debian/control: Make the description a little more distinctive than
  gnupg v1's. Thanks Jari Aalto. (Closes: #496323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
465
465
  FILE *out_fp;
466
466
  int rc;
467
467
 
 
468
  (void)line;
 
469
 
468
470
  inp_fd = translate_sys2libc_fd (assuan_get_input_fd (ctx), 0);
469
471
  if (inp_fd == -1)
470
472
    return set_error (GPG_ERR_ASS_NO_INPUT, NULL);
519
521
  FILE *out_fp;
520
522
  int rc;
521
523
 
 
524
  (void)line;
 
525
 
522
526
  inp_fd = translate_sys2libc_fd (assuan_get_input_fd (ctx), 0);
523
527
  if (inp_fd == -1)
524
528
    return set_error (GPG_ERR_ASS_NO_INPUT, NULL);
562
566
  int out_fd = translate_sys2libc_fd (assuan_get_output_fd (ctx), 1);
563
567
  FILE *out_fp = NULL;
564
568
 
 
569
  (void)line;
 
570
 
565
571
  if (fd == -1)
566
572
    return set_error (GPG_ERR_ASS_NO_INPUT, NULL);
567
573
 
643
649
  int rc;
644
650
  int fd = translate_sys2libc_fd (assuan_get_input_fd (ctx), 0);
645
651
 
 
652
  (void)line;
 
653
 
646
654
  if (fd == -1)
647
655
    return set_error (GPG_ERR_ASS_NO_INPUT, NULL);
648
656
 
922
930
  int rc;
923
931
  estream_t in_stream;
924
932
 
 
933
  (void)line;
 
934
 
925
935
  inp_fd = translate_sys2libc_fd (assuan_get_input_fd (ctx), 0);
926
936
  if (inp_fd == -1)
927
937
    return set_error (GPG_ERR_ASS_NO_INPUT, NULL);
1016
1026
 
1017
1027
     version     - Return the version of the program.
1018
1028
     pid         - Return the process id of the server.
 
1029
     agent-check - Return success if the agent is running.
1019
1030
 
1020
1031
 */
1021
1032
static int
1035
1046
      snprintf (numbuf, sizeof numbuf, "%lu", (unsigned long)getpid ());
1036
1047
      rc = assuan_send_data (ctx, numbuf, strlen (numbuf));
1037
1048
    }
 
1049
  else if (!strcmp (line, "agent-check"))
 
1050
    {
 
1051
      ctrl_t ctrl = assuan_get_pointer (ctx);
 
1052
      rc = gpgsm_agent_send_nop (ctrl);
 
1053
    }
1038
1054
  else
1039
1055
    rc = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
1040
1056
  return rc;